Repository navigation
Fail instead of silently skipping FP8 in the CUDA execution kernel - #953
Open
0z5a (0z5a) wants to merge 1 commit into
Open
0z5a (0z5a) wants to merge 1 commit into
0z5a (0z5a) wants to merge 1 commit into
Conversation
launchKernel had no FP8 instantiation on CUDA and just returned, so Executor::execute reported success with the output buffer left untouched. Throw InvalidUsage there, for DataType::AUTO as well. matchExecutionPlan did not look at the data type, so the NCCL shim could pick a DSL plan for an FP8 allreduce and hit that path. Reject FP8 there on CUDA so the request falls through to the native algorithms, which do support it.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This branch has not been deployed
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.
why
On CUDA, running an FP8 reduction through a DSL plan returns success without doing anything. The output buffer is left as it was and no error is raised.
launchKernelinsrc/core/executor/execution_kernel.cuhandles the FP8 types with a barebreak;, so no kernel is launched.Executor::executeandDslAlgorithm::executepass FP8 through to it and report success.The NCCL shim can reach this too.
matchExecutionPlandoesn't look at the data type, andalgoSelectortries matching DSL plans before the native algorithms. So once a DSL plan matches the world size, ranks per node, buffer mode and message size, anncclAllReduceonncclFloat8e4m3returnsncclSuccesswith the input unchanged, even though the native algorithms handle that request correctly.Reproduced on 2× B300 (CUDA 13.3, driver 610.57) at 001e93e. This is an in-place 2-rank allreduce of 1 MiB, with rank 0 holding 1.0 and rank 1 holding 2.0, so the expected result is 3.0 (
0x44):Executor::executeExecutor::execute0x38/0x40)ncclAllReduce, DSL plan registeredncclSuccessncclAllReduce, DSL plan registeredncclSuccessncclAllReduce, no DSL planncclSuccess0x44The
ncclAllReducerows come from a small program run underLD_PRELOAD=libmscclpp_nccl.so. It registers a 2-rank in-place allreduce plan (generated withpython/mscclpp/language/tests/single_node/allreduce.py --num_gpus 2, whose message size range covers 1 MiB) as aDslAlgorithmbeforencclCommInitRank. The source is at the end of this description.From reading the code, not run:
bench_collective --enable-dslhas no data type filter for DSL candidates, so an FP8 sweep would time these no-ops as if they were real results. With this PR they raise, and the existing handler reports them as[skip].what changed
launchKernel(CUDA): the FP8 cases now throwInvalidUsage.DataType::AUTOdoes too. Nothing in the tree passes it there, and the HIP version already asserts on it.matchExecutionPlan: rejects FP8 on CUDA, so the shim falls through to the native algorithms instead of hitting the new error. HIP is unchanged because its execution kernel has FP8 instantiations.ExecutorTest.CudaRejectsFp8: newmp_unit_testscase covering all five FP8 types.This doesn't add FP8 to the CUDA execution kernel. If you'd rather have that, in the way HIP does, I can look at it separately. Until then, failing seems better than returning a wrong result.
verification
Same setup, same check programs, with this PR applied:
Executor::executeExecutor::executeInvalidUsagencclAllReduce, DSL plan registeredncclSuccessncclAllReduce, DSL plan registeredncclSuccess0x44ncclAllReduce, no DSL planncclSuccess0x44mpirun -np 2 mp_unit_tests --filter=ExecutorTest(sm_103a build):main:CudaRejectsFp8fails on all five types andTwoNodesAllreducepasses.clang-format --dry-run --Werror(18.1.8 and 20.1.8) andgit diff --checkpass on the changed files.Not covered:
launchKernelis CUDA-only.bench_collectiveitself.NCCL check program