Repository navigation
Conversation
…a build and a backend per KV cache dtype
…oy example on a bf16 or FP8 KV cache
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.
What does this PR do?
Adds an FP8 e4m3 KV cache to the GB300's NVFP4 decode megakernel and its draft kernel, beside the bf16 one on
main:serve with
engine.kv_cache_dtype=fp8_e4m3(the default stays bf16). The backend is chosen by the engine's KV cache dtype, as it already is by the GPU and the checkpoint.csrc/, as in the RTX PRO 6000 PR: bf16 KV (no flag: the build onmain, its op namespaces unchanged) and FP8 KV (-DMK_KV_FP8=1, op namespaces of its own).blackwell/gpu_backend.pyhas a backend per KV cache dtype; the build classes carry what depends on the dtype (the cache's view, the scale check, the loaded build's ops).Fp8KvCacheMixin(an FP8 backend refuses calculated KV scales: the kernels read the cache at scale 1) is indeploy/gpu_backend.py. The RTX PRO 6000 PR adds the same class at the same place, so the two merge into one.gpu/gb300.yamlnames the KV cache dtype, the deploy README's hardware table gains a KV cache column, and the README's News names the FP8 cache's speed. The RTX PRO 6000 PR edits the same table,run_server.sh,deploy_kernels.pyand the recipe test.main.How was it verified?
CI's CPU jobs pass locally (
pre-commit, the tests job'spytest: 1,128 passed), with new tests for the backend per KV cache dtype, the builds, the cache's view and the scale check.On GB300 nodes, the branch against the FP8 kernel it was ported from and against
main, on one node with the same inputs:Generated code: instruction-identical to the kernels it was ported from (FP8 KV) and to
main(bf16 KV, and the bf16 checkpoint's megakernel).Outputs: the accuracy gate, its four sampling variants and decode-only launch dumps are bitwise equal; the acceptance run's 16 answers are the same token for token (acceptance length 3.19).
End to end:
run_server.shserves the recipe's 260,096-token window on each cache, and a two-turn chat decodes on the megakernel.Speed: the verify step's period is within the noise at all 12 contexts for both pairs (four rounds):
main, bf16 KVWith the DFlash2 checkpoint, measured as the README's GB300 figure (logged robot-control requests through the recipe's server, decode time from the server's metrics; two servers each, over the requests that all four answered to the 2,048-token limit):
Checklist
[module] type: description, for example[envs] fix: the reset of a stale episode. CI checks it against the modules and types of.github/scripts/pr_title.py.pre-commit run --all-filespasses.3rdparty/*/patcheswas exported by the scripts there.