Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/rdna-compute/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3065,6 +3065,24 @@ impl Gpu {
.checked_mul(dtype.size())
.ok_or_else(|| HipError::new(0, "VMM tensor byte size overflowed"))?;
let mut arena = VmmArena::reserve(&self.hip, self.device_id, byte_size)?;
// WINDOWS FIX (2026-09-09): hipMemCreate/hipMemMap on Windows/ROCm 7.2
// (gfx1100) maps a second, later segment onto the SAME physical pages as
// the first (vmm_arena_smoke boundary-growth assert fails; every
// subsequent KV growth corrupts all prior KV -> token soup). Single
// segment maps are proven correct. So on Windows, map the FULL
// reservation in one map_next up front instead of growing in small
// segments; grow_vmm_tensor then becomes a no-op (already fully
// mapped). Costs up-front VRAM for the whole reservation; correctness
// over on-demand commit on the platform whose driver breaks growth.
#[cfg(windows)]
let initial_mapped_bytes = {
// map_next requires a multiple of the allocation granularity
let granularity = arena.granularity();
byte_size
.checked_add(granularity - 1)
.map(|v| v / granularity * granularity)
.unwrap_or(byte_size)
};
if initial_mapped_bytes > 0 {
if let Err(err) = arena.map_next(&self.hip, initial_mapped_bytes, access_devices) {
return Err(self.retain_failed_vmm_arena(arena, err));
Expand Down