mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #438] Build fails with __nv_fp8_e4m3 undefined (CUDA 12.9, H100 and B200) #193
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sarose550 on GitHub (Sep 11, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/438
Build fails with
__nv_fp8_e4m3undefined (CUDA 12.9, H100 and B200)I'm trying to benchmark
mega_mhc. This is the new code that landed in #432 on September 10.Building DeepGEMM at
66081d4withbash ./develop.shfails with:The host build never includes
cuda_fp8.hbecause CUTLASS gates it behindCUDA_FP8_ENABLED, which requires__CUDACC_VER_*- undefined in host g++.Since this is host compilation, the attached GPU shouldn't matter; I tested both to confirm. The same error occurs with stock PyTorch on H100 and B200, and with NGC PyTorch on H100. Host g++ fails while compiling
csrc/python_api.cpp, before any GPU kernels run.nvcr.io/nvidia/pytorch:25.06-py3pytorch/pytorch:2.8.0-cuda12.9-cudnn9-devel2.8.0a0+5228986c39.nv25.062.8.0+cu1292.8.0+cu129(10, 0)The containers have
libdw-dev,elfutils,libelf-dev,git, andbuild-essential.I checked the submodules against the pinned commits; neither has drifted:
To reproduce inside the container:
The include chain looks like the problem.
mega_mhc.cuhincludescommon/math.cuh, which includes CUTLASS'snumeric_types.h, thenfloat8.h.In the pinned CUTLASS,
CUDA_FP8_ENABLEDdepends on__CUDACC_VER_MAJOR__/__CUDACC_VER_MINOR__. Thecuda_fp8.hinclude is guarded byCUDA_FP8_ENABLED. Those macros aren't defined in this host build. The NGC preprocessor trace (-E -H -dD) contains CUTLASS'sfloat8.h, but nocuda_fp8.hor declaration of__nv_fp8_e4m3.The CUDA header is installed, and this standalone test passes with the host compilers in all three environments:
For the stock GCC 13 runs, the compiler was
/usr/bin/g++-13. NGC usedx86_64-linux-gnu-g++with the snippet on stdin./usr/local/cudaresolves to/usr/local/cuda-12.9; the compiler paths point to that toolkit. The NGC preprocessed headers reportCUDA_VERSIONandCUDART_VERSIONas12090.I haven't patched DeepGEMM or forced an include, so the standalone test doesn't establish whether that would fix the whole build. Neither the Hopper test nor
test_mega_mhc.pywas reached.Should
mega_mhc.cuhincludecuda_fp8.hdirectly?Full compiler commands
NGC command that reaches the FP8 error:
Stock GCC 13 command that reaches the same FP8 error on both H100 and B200:
Stock Modal image definition
GCC 13 supplies the
<format>support missing from stock GCC 11;CCandCXXselect it below.The stock base image digest was
sha256:cf5aa3f7045a68c10d80f546746591c5ccae6a33729e5e32625ff76bd2c036fe(linux/amd64).@MARD1NO commented on GitHub (Sep 11, 2026):
Also meet this problem,
add #include <cuda_fp8.h> in deep_gemm/include/deep_gemm/layout/mega_mhc.cuh
@XFDG commented on GitHub (Sep 11, 2026):
Hi maintainers, I've submitted a fix in #439.
The root cause:
mega_mhc.cuhuses__nv_fp8_e4m3inNormArgs, which is compiled by host g++ viacsrc/python_api.cpp. CUTLASS gatescuda_fp8.hbehindCUDA_FP8_ENABLED(which requires `_CUDACC_VER*", defined only by nvcc), so the type is invisible to g++ during host compilation.The fix adds an explicit
#include <cuda_fp8.h>at the top ofmega_mhc.cuh, before any other includes. Verified to build on B200 (SM100, CUDA 13.1, gcc-13).@XFDG commented on GitHub (Sep 11, 2026):
Hi, I've submitted a fix in https://github.com/deepseek-ai/DeepGEMM/pull/439.
Verified on B200 (SM100, CUDA 13.1, gcc-13):
bash ./develop.shcompletes without errors andimport deep_gemmworks correctly. Let me know if you'd like any changes.@Sarose550 commented on GitHub (Sep 11, 2026):
Which TileKernels revision does
test_mega_mhcexpect?