mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-05 18:49:25 -05:00
refactor(thermal): remove the graphics card heat map
With short steps only around the torch, the processor is faster than the card at the quarter-inch cells full sheets use, and the card only gained at a cell size they do not use. Drop OpenNest.Gpu, the ILGPU dependency and the accelerator interface; the heat map runs the same on every computer. The measured card timings stay in docs/plate-heat-map.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
151a92088f
commit
85c4c8486e
21 files changed
+92
-959
No files matched your search
+10
-30
@@ -16,9 +16,7 @@ a removed heat-aware sequencer used a cheaper estimate of the same physics ([Seq
|
||||
costs up to sixteen times the work, since diffusion shortens the time step with the cell's
|
||||
area. Automatic grids have at most 700,000 cells, and any size asked for is made coarser past
|
||||
that. Each cell holds its temperature rise above ambient. Finer cells hold the torch's heat in
|
||||
less metal, so cells along the cut read hotter; compare cut orders at one cell size. An
|
||||
[accelerator](#graphics-card) does not change the cell size, so every computer draws the same
|
||||
picture.
|
||||
less metal, so cells along the cut read hotter; compare cut orders at one cell size.
|
||||
- Heat in: while the torch is on (cuts and pierces), `AbsorbedPower` watts go into the sheet at
|
||||
the torch, in proportion to the time spent there. The path is sampled four times per cell, and
|
||||
each sample is shared between the four cells whose centers surround it, by closeness, among
|
||||
@@ -33,7 +31,7 @@ a removed heat-aware sequencer used a cheaper estimate of the same physics ([Seq
|
||||
are insulated. A rise below 1e-30 °C is set to zero: the front of the spreading heat would
|
||||
otherwise pass through subnormal floats, which make each step several times slower. It changes
|
||||
no cell above about 1e-18 °C.
|
||||
- Short steps only around the torch: on the processor, the short steps of a slot are taken only by
|
||||
- Short steps only around the torch: the short steps of a slot are taken only by
|
||||
the window of cells within four cells of where the torch put heat during those steps or during
|
||||
the slot before them (which keeps the cells beside a fresh cut on short steps until their own
|
||||
peak has passed). The cells touching the window hold their starting values meanwhile, and every
|
||||
@@ -95,34 +93,16 @@ The simulator builds and runs the model off the UI thread (`HeatEstimate`) and s
|
||||
"Estimating heat…" meanwhile. A changed setting cancels the run in progress; a rebuilt timeline
|
||||
with the same moves and settings keeps the model it has.
|
||||
|
||||
## Graphics card
|
||||
## Timings
|
||||
|
||||
`ThermalParameters.Accelerator` runs grids of 250,000 cells or more elsewhere; smaller ones stay
|
||||
on the processor, which is the faster for them: a card takes longer to start each short step than
|
||||
the processor takes over the cells around the torch. A 5×10 ft sheet's 0.25 in cells (115,200)
|
||||
therefore run on the processor on every computer, and the card serves only finer grids, which
|
||||
automatic cell sizes seldom reach (a `CellSize` of 0.125 in on a full sheet does). The cut
|
||||
simulator passes `GpuHeatAccelerator.OnDemand`, which starts the card (about half a second, once)
|
||||
only when a grid first asks for it. `OpenNest.Gpu`
|
||||
is the one implementation: ILGPU, using CUDA on an NVIDIA card, otherwise OpenCL where ILGPU
|
||||
accepts the driver (not verified on AMD or Intel cards; Apple graphics are not supported). Without
|
||||
a usable card, or when it fails while building or playing (out of memory, driver fault), the model
|
||||
runs on the processor.
|
||||
Measured on a Ryzen 7 3700X, 5×10 ft nests, 0.25 in and 16 gauge mild steel at 100 to 1600 in/min,
|
||||
whole run: 0.25 in cells took 0.9-2.9 s before the window and take 0.23-0.45 s with it; a cut of
|
||||
several hours takes about 3 s. 0.125 in cells take 1.3-6.2 s (11-22 s before).
|
||||
|
||||
The simulation keeps the pieces, timeline and checkpoints and the card keeps the temperatures.
|
||||
On the card every cell takes the short steps, so its picture differs from the processor's by what
|
||||
the window costs (above). Against the processor taking whole-plate steps too, its results are
|
||||
within one part in a million, not bit for bit (devices may fuse a multiply and an add). The
|
||||
processor stays the reference. `GpuHeatAcceleratorTests` compares the card with whole-plate steps
|
||||
on the processor within a tolerance, running the card's programs on ILGPU's processor emulation
|
||||
everywhere and on a real card where there is one (skipped otherwise, as on build agents). A
|
||||
change to `DiffuseCells` or `Add` needs the same change in `OpenNest.Gpu/HeatKernels.cs`.
|
||||
|
||||
Measured on a Ryzen 7 3700X and an RTX 4060, 5×10 ft nests, 0.25 in and 16 gauge mild steel at
|
||||
100 to 1600 in/min, whole run: 0.25 in cells took 0.9-2.9 s on the processor before the window
|
||||
and take 0.23-0.45 s with it; the card takes 0.45-1.0 s, most of it the fixed cost of starting
|
||||
two programs per step, which is why this cell size stays on the processor. 0.125 in
|
||||
cells take 1.3-6.2 s on the processor (11-22 s before) and 1.1-2.7 s on the card.
|
||||
A graphics card version (ILGPU, every cell taking the short steps) was built and measured on an
|
||||
RTX 4060, then removed: at 0.25 in cells it took 0.45-1.0 s, slower than the processor, since
|
||||
starting its two programs per step costs more than the step; at 0.125 in it took 1.1-2.7 s, a
|
||||
cell size full sheets do not use.
|
||||
|
||||
## Display
|
||||
|
||||
|
||||
Reference in new issue
Block a user