Repository navigation
0.7 round: fixes from the GPU machines (HIP, the disk cache, Level Zero) - #373
Merged
Merged
Conversation
On ROCm 7.1.1 (two MI210s, gfx90a), hipRTC at -O2 and above passed some inlined __tack_in_bounds__ calls a 64-bit index whose low half was right and whose high half was 0x3f000000, so accesses in bounds were reported out of bounds and skipped: the edge_id check in subdivide's _values on high-order spaces, five test_high_order.py cases under TACK_DEBUG=1. -O0 and -O1 were right, and so is __noinline__ at the default -O3. HIP gets its own bounds dialect; CUDA's helper stays inline.
_stored_on_device took VTK's dlpack_support for a VTK that keeps device memory in device arrays. VTK master's nightly wheels have the module but wrap device memory through a Viskores built for none of Tack's GPUs, and refuse HIP memory, so every VTK algorithm on a HIP dataset failed (examples 50, 52 and 53; test_vtk_interop's two device tests). Each device is now probed once (_vtk_holds: one value shared, the memory space of VTK's array read), and a device VTK cannot hold goes through the host, as with a VTK without DLPack. The device tests run only where VTK holds the device's memory.
…ds check helper not inlined
…ived domain_view added face and edge incidence to a cell view whenever the topology's faces or edges had been derived, by this filter or any before it. The same kernel over the same cells then compiled again after another filter derived them (contour, project, subdivide on a mesh surface_normals or a flux had touched), and the disk cache gained entries from one run to the next as the order of filters changed. A kernel that reads incidence now asks for it, domain_view(..., incidence="faces"/"edges") and for_each(..., incidence=...), and the view derives it; a curved geometry still reads what its nodes need.
_structured_face_tables reads its tables once a process from the general derivation of a tiny grid, which ran on the device of the first filter to need them: its sort kernels compiled for that device, a GPU's or the no-f64 stand-in's, depending on which test came first. The tables are host arrays; the tiny grid is now the CPU's every time.
On a Max 1100 (IGC 2.7.11, compute runtime 25.05.32567.17), IGC's code for five tack-vis kernels was wrong: _roots and _straight_rows (crossings), _trace_simplex_straight (subdivide) and _ghost_points_of/_ghost_cells_of (AMR ghosts). They failed the f32 high-order contour, the Bernstein pieces and the simplex contour and slice with 64-bit ids, and vis2_amr's ghost_cells. Per-kernel -ze-opt-disable fixed some and hung _roots on another input, and every other IGC option tried fixed _roots for one id width only. Required SIMD16 fixes all five, fully optimized; required SIMD32 fails like the default. The attribute is in the OpenCL source, which only Level Zero compiles, so no other backend's code changes. With it the whole suite, tack-vis with 64-bit ids and debug mode's quick tier pass on Level Zero, and vis2_amr's ghost cells equal the CPU's.
…has one Under a VTK that holds Level Zero memory (VTK master's Viskores on Kokkos' SYCL), device="level_zero" made Tack's own context, and VTK refused the filters' outputs as from another context. The examples make the device with init_level_zero() where VTK has a context to share, else Tack's own, and pass that device to the filters.
…ithout one 42 and 43 call init_level_zero(), which raises RuntimeError under a VTK without DLPack support or without a Level Zero context (VTK's wheel). The sweep skipped only a missing module, so both failed on Level Zero machines.
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fixes from the 0.7 round on the GPU machines that #370 did not cover: illyad (HIP), jura's disk-cache investigation (CUDA) and headroom (Level Zero).
HIP: debug mode's bounds check helper is
__noinline__(illyad). hipRTC (ROCm 7.1.1) at-O2and above miscompiled__tack_in_bounds__when inlined, and fivetest_high_order.pycases reported in-bounds accesses as out of bounds. CUDA's stays inline. Added tovendor-workarounds.md.VTK interop: share GPU memory only with a VTK that holds that GPU's (illyad). VTK master's nightly wheels have
dlpack_support, but their Viskores is CPU-only, whilesupported_device_types()still lists CUDA and ROCm, so wrapping a device array failed._vtk_holdsnow probes once per device memory domain whether VTK actually holds that device's memory. If it doesn't, the array is copied. This replaces the check #370 made per device type.The disk cache settles again (jura).
domain_viewused to give cells face and edge incidence whenever another filter had already derived the faces or edges, so the same kernel compiled for a different view class depending on which filters had run first. Breaking: a kernel that readsface_id,edge_id, ... now asks for them:for_each(..., incidence="faces")or"edges", and the same keyword ondomain_view. Eight filters,sets, the entity traces, three tests and the docs example now ask._structured_face_tablesderives its tiny grid on the CPU, not on whichever device asks first.Level Zero: every kernel requires sub-groups of 16 (headroom). On the Max 1100 (IGC 2.7.11, compute runtime 25.05), IGC's SIMD32 code for five tack-vis kernels was wrong:
_rootsand_straight_rowsin_crossings.py,_trace_simplex_straightinsubdivide.py, and_ghost_points_ofand_ghost_cells_ofinamr_ghosts.py. They broke high-order contours and slices in f32 and with 64-bit ids, simplex subdivision, and the AMR ghost marks ofvis2_amr. Required SIMD16, fully optimized, is right in every case; compute runtime 26.40 does not fix it. The attribute appears only in the OpenCL that Level Zero compiles. Added tovendor-workarounds.mdand CLAUDE.md.Examples on Level Zero under a VTK holding Level Zero memory (headroom).
init_level_zero()where VTK has a Level Zero context, and fall back to Tack's own context where it has none. Under VTK master (Viskores on SYCL), 50, 52 and 53 failed because VTK refused their outputs as coming from another context. Letting the algorithms adopt VTK's context is left for 0.8, when VTK has device arrays.init_level_zero()raises because this VTK has no DLPack support or no Level Zero context, as with VTK's wheel. Before, they failed on every Level Zero machine.Dropped as duplicates of #370: illyad's and headroom's Permutation test fix, and headroom's OpenFOAM fetch for examples 51 and 52. The tack-examples port fixes are on that repository's main.
Tested
--ids=i64(5412 passed) and the debug quick tier (4382 passed), all with 0 failures.vis2_amr's ghost cells equal the CPU's.level_zero(skipped with the reason), and ruff, SPDX and the changelog check.After this merges, a targeted round on each GPU machine will cover what these touch: VTK master, the device arrays, examples 50-53, debug mode, the dataset filter tests and two cached quick passes.
🤖 Generated with Claude Code