kernel: clamp zero-size host registrations; WDDM lock-pool hint on pin failure - #56
kernel: clamp zero-size host registrations; WDDM lock-pool hint on pin failure#56Glucksberg wants to merge 6 commits into
Conversation
…idance on pin failure cudaHostRegister rejects a 0-byte request with cudaErrorInvalidValue. The NVFP4/FP8 offload loaders register per-layer scale banks whose padded size can round to zero on dense layers, which aborts the whole pin pipeline with a cryptic 'cudaHostRegister failed for 0.0 GiB'. Clamp to 1 byte so the bank maps like every other one (parity with alloc_pinned_tensor, which already does 'nbytes == 0 ? 1 : nbytes'). Also re-raise HostBank.pin failures with the bank size and an actionable hint: on Windows/WDDM the pageable-locking pool is roughly half of system RAM, so large MoE models can exceed it even with free RAM available. Repro: RTX 3080 Ti 12 GB / 32 GB RAM / driver 591.86 (CUDA 13.1), serving ornith-ai/Ornith-1.5-35B-A3B-NVFP4 -- fails at PinPipeline.wait() with 'failed for 0.0 GiB' before this change.
|
Merged and tested on Linux / 2× RTX 6000 Ada, serving a 143 GiB offloaded expert pool. No regressions — full suite 1606 passed, and nothing attributable to this change. The zero-size clamp is worth having on Linux too, not just WDDM: On the pin-failure guidance: I hit the Linux flavour of this problem from the other direction and it cost about an hour, so the instinct behind this PR is a good one. There, Worth knowing if you add that: limits apply at session start, so an SSH ControlMaster will keep serving the old limit after the config is fixed, which makes the fix look like it did not work. +1 as is. |
…nch) Per review on FlashML-org#56: on Linux the equivalent ceiling is RLIMIT_MEMLOCK (default RAM/8), and the failure surfaces minutes into a load with no hint about memlock. The re-raised error now reports the current soft limit and points at ulimit -l / /etc/security/limits.d/*.conf, plus the ControlMaster gotcha (limits apply at session start; ssh -O exit first). Windows branch unchanged.
|
Thanks @gdevenyi — pushed |
…false positive); human-readable RLIMIT formatting
What
Two small, self-contained fixes found while debugging Windows/WDDM pin-quota failures with large MoE models (full repro and measurements in #55):
host_register: clamp zero-byte registrations to 1 byte.cudaHostRegisterrejects a 0-byte request withcudaErrorInvalidValue. The NVFP4/FP8 offload loaders register per-layer scale banks whose padded size can round to zero on dense layers, which aborts the entire pin pipeline with a crypticcudaHostRegister failed for 0.0 GiB.alloc_pinned_tensorin the same file already clamps (nbytes == 0 ? 1 : nbytes) — this makeshost_registerconsistent with it.HostBank.pin: actionable error on lock-pool exhaustion. On Windows/WDDM the pageable-locking pool is roughly half of system RAM, so registering ~17 GB of MoE banks on a 32 GB box fails with a bare driver OOM long before system RAM is exhausted. The re-raised error now carries the bank size plus a hint (free RAM / add RAM /--moe-backend cpu), instead of justcudaHostRegister failed for 13.77 GiB.Validation
ornith-ai/Ornith-1.5-35B-A3B-NVFP4.PinPipeline.wait()withRuntimeError: cudaHostRegister failed for 0.0 GiB.alloc_pinned_tensorhas used the identical guard since it shipped).Notes
These unblock diagnosing the bigger residency gap tracked in #55 (LOCKED/PAGEABLE movement paths are scaffolded but not implemented). Not included here to keep the diff minimal.