Skip to content

release(v0.5.0): shared host runtime, buffer safety, and debugging - #1613

Closed
elibol wants to merge 105 commits into
NVIDIA:release/v0.5.xfrom
elibol:release/v0.5.0-host-debug-integration
Closed

elibol wants to merge 105 commits into
NVIDIA:release/v0.5.xfrom
elibol:release/v0.5.0-host-debug-integration

Conversation

@elibol

@elibol elibol commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

cuTile Rust v0.5.0 integration covering:

  • Shared CUDA contexts, streams, allocations, and async runtime across Tile and SIMT.
  • Safer buffer casts and ownership, tensor shape validation, and correct slice offsets.
  • Improved source locations for generated and inlined code, consistent device debug modes, and CUTILE_JIT_* overrides.
  • Correct binding layouts with libclang 22, FP8 capability checks, and benchmark smoke coverage.

These changes are already included in release/v0.5.x; this PR currently has no remaining file diff.

Superseded by #1744, from elibol:release/v050-tile-features into main.

Arthur031221 and others added 26 commits October 4, 2026 04:44
Use captured module spans for source locations and the current function
definition for generated types, arrays and wrapper calls. Add regressions
using the assertion kernel from NVIDIA#1379 and a helper in another file.

Co-authored-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
Signed-off-by: Melih Elibol <elibol@users.noreply.github.com>
DeviceBuffer::cast_elem, DeviceBuffer::cast_chunks, and Tensor::reinterpret
reinterpreted device bytes as any element type of the right size and
alignment, which let a u8 buffer become a DeviceBuffer<bool> or Tensor<bool>
holding values other than 0 and 1 (NVIDIA#1506). The casts now require
bytemuck::AnyBitPattern of their target, so bool is rejected at compile time,
and bool implements DeviceCopy: a typed buffer holds valid values by
construction, so bool buffers can be allocated, filled, launched, and read
back like any other element type. cuda-core re-exports bytemuck, implements
Pod for the DType newtypes, and enables half's bytemuck feature for f16 and
bf16.

The atomic wrappers in cuda-device are not Copy, so they cannot be
AnyBitPattern. DeviceBuffer gains wrap_elem and peel_elem, bounded on
bytemuck::TransparentWrapper, to view a scalar buffer as its atomic wrapper
and back. cuda-device implements TransparentWrapper for its atomic types and
Pod for its vector types, and the examples that cast into atomics use the new
methods. Every example lock gains the bytemuck dependency of cuda-device.

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
…pression span

Short-circuit boolean operations (`a && b`, `a || b`) generate deciding
constants when the left-hand operand decides the outcome. Previously,
`compile_bool_constant` created constants from synthesized `bool` type
spans, resolving to fallback module-header locations.

Pass the logical expression's span through `compile_bool_constant` and the
shared constant builder (`compile_constant_from_exact_bounds`), ensuring
the resulting constant operation receives the exact expression line while
preserving inlined helper scopes and call chains.

Add regression test in `debug_info.rs` verifying source line attribution
and inline caller provenance for both direct and inlined expressions.

Part of NVIDIA#1475.

Signed-off-by: GiGiKoneti <gigikoneti@gmail.com>
Signed-off-by: Trent Nelson <trent@trent.me>
…nMode

`tileiras` accepts `--device-debug` only at optimization level 0, but
`CompileOptions` kept the level and the debug flag as independent fields.
Debug builds default to full debug, so adding only `.opt_level(3)` produced
`--opt-level 3 --device-debug`, which `tileiras` rejects at JIT time.

Replace `opt_level`, `device_debug`, and `lineinfo` with
`codegen: CodegenMode`, where `Debug` owns level 0 and
`Optimized { level, lineinfo }` covers the rest. Every value now maps to
flags `tileiras` accepts. `debug_info()` and `opt_level()` select a mode,
and the last call wins. The level-0 default rule in
`TileirasOptions::from_compile_options` is gone, and the frontend reads the
same mode to decide check hoisting.

Remove the `device_debug(bool)` and `lineinfo(bool)` setters, which
`debug_info()` covers. The cache key and entry header bytes are unchanged
for every mode; a test pins them against the previous encoding.

Signed-off-by: almightychang (Sam, Joochul Chang) <almightychang@icloud.com>
Nothing could switch an already-built application to a debug or sanitizer
build without changing its code. Add three process-wide variables, read
once per process:

- CUTILE_JIT_DEBUG=none|line|full acts like `debug_info()`
- CUTILE_JIT_OPT_LEVEL=0|1|2|3 acts like `opt_level()`
- CUTILE_JIT_SANITIZE=memcheck|none acts like `sanitize_memcheck()`

Each applies after the code's options, as if its setter were called last.
`CompileOptions::with_jit_env_overrides()` applies them once before both
compile stages, so the frontend's check placement and the `tileiras` flags
always come from the same options. Invalid values, and full debug together
with an explicit level, return a JIT error naming the variable.

This continues NVlabs/cutile-rs#237, which applied the overrides only to
the `tileiras` flags and left the frontend hoisting checks under
`CUTILE_JIT_OPTIMIZATION=debug`.

Signed-off-by: almightychang (Sam, Joochul Chang) <almightychang@icloud.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
…nd SIMT

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
…uncher

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Retain the source-scope map when line tables are enabled so native
debug metadata includes inline call chains without variable debug info.

Signed-off-by: Trent Nelson <trent@trent.me>
Check the file, definition line, subprogram and caller chain of the
generated constants in the assertion kernel and in a nested cross-file
helper, in Line and Full, and that the same locations are present in the
serialized bytecode. A user literal in the same kernel must keep its own
line. An opt-in test checks the cubin line table with nvdisasm and DWARF.

Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
…cesses

Every override case now runs in a child process that inherits no
CUTILE_JIT_* setting and is selected by a dedicated marker variable. The
cases cover explicit none, line with an opt level, full, an invalid value,
the full/opt-level conflict, and the read-once rule.

The cache-key check compares keys reported by independent processes, each
under its own overrides, so a key that dropped the effective mode would
let two distinct modes collide. A GPU test runs the normal launcher
against one shared disk store and checks the kernel result, the check
placement, and whether stage 2 came from tileiras or the store.

Signed-off-by: almightychang (Sam, Joochul Chang) <almightychang@icloud.com>
…eBuffers

Signed-off-by: nihalpasham <nihalp@nvidia.com>
…viceBox::from_raw_parts and update docs

Signed-off-by: nihalpasham <nihalp@nvidia.com>
…NVIDIA#1602)

Preserve source locations and inline caller chains for const-generic arrays,
generated reduction bodies, and checks relocated to the host. Keep deduplicated
check origins private to the compiler and render them through the existing
diagnostic API.

Part of NVIDIA#1475. The remaining frontend items and debugger/backend fixes remain
tracked separately; this does not close the full source-location audit.

Validated with the CPU/assembler suites, source-location regressions, live
CUDA-GDB tests, GPU host-check enforcement, host/Tile semver checks, and all
25 active CI checks on 825de3e.

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
(cherry picked from commit 9718b43)
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test c6c5a86

elibol added 11 commits October 30, 2026 12:38
…ries

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
…tree

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
…d async tree

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Merge main through NVIDIA#1541, NVIDIA#1683 and NVIDIA#1634. Resolve workflow conflicts using the accepted NVIDIA#1580 copy-pr-bot triggers.

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test dfd6867

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 54be19d

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 2c01bfb

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test e16b73a

Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
@elibol

elibol commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test d2c8120

@elibol elibol changed the title release(v0.5.0): integrate shared host runtime and source-location fixes release(v0.5.0): shared host runtime, buffer safety, and debugging Nov 4, 2026
@elibol elibol closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants