Repository navigation
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@BBuf The initial CI fan-out failed only because the PR was opened as a draft ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 506ea95664
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cudaStream_t stream = at::cuda::getCurrentCUDAStream(); | ||
| copy_to_gpu_no_ce_fallback_kernel<<<grid, block, 0, stream>>>(input_array, n, output.data_ptr<int>()); |
There was a problem hiding this comment.
Launch the fallback on the output tensor's device
When output is on a CUDA device other than the current device, which the input checks currently permit, a fallback-size call such as N=17 obtains the current device's stream and launches there while passing a pointer owned by output.device(). This can fail with an invalid-device-pointer error or, when peer access is enabled, perform an unordered cross-device write. Guard output.device() before retrieving the stream and launching the kernel.
Useful? React with 👍 / 👎.
|
This is still needed on current I've merged current @BBuf @ispobock could one of you run |
This comment has been minimized.
This comment has been minimized.
BBuf
left a comment
There was a problem hiding this comment.
[BBuf Review Agent] One thing to fix before this can go in.
Still open from my last review:
- Guard the output device before resolving the launch stream (
python/sglang/kernels/aot/csrc/elementwise/copy.cu:70)
Motivation
Fixes #32507.
CPU OffloaderV2's CPU mode requires the DeepEP expert-count vector to reach
the GPU without using a copy engine.
copy_to_gpu_no_ceonly instantiatedN=32, 64, and 72, so a valid 256-expert/EP16 configuration produced N=16 and
failed during prefill warmup with
RuntimeError: unexpected N.This is the same fixed-shape failure class previously addressed for N=32 in
#23550.
Modifications
copy engine.
N=512 boundary, and N=513 rejection.
Compared with the always-generic approach in #32515, the hybrid dispatch keeps
small launch arguments for common expert counts while remaining robust to new
counts.
Accuracy Tests
The modified CUDA source was compiled and exercised directly on an NVIDIA L40S
with CUDA 12.8 and PyTorch 2.10:
The operation is an exact
int32control-vector copy; it does not alter modelarithmetic.
Local static checks:
Speed Tests and Profiling
NVIDIA L40S, CUDA 12.8, PyTorch 2.10, median of 7 repetitions with 20,000
operations per repetition:
The exact specialization was 7.6% lower latency than always passing the
512-element generic argument and 47.3% lower latency than the copy-engine
fallback in this microbenchmark.
Checklist
CI States
Latest PR Test (Base): ❌ Run #42526380267
Latest PR Test (Extra): ❌ Run #42526380256
Latest PR Test (AMD ROCm 10): ❌ Run #42526380298
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: