mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #336] maya-ds4 fails to compile on Tesla V100 (Volta) due to undefined __bfloat16_as_ushort #130
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
mw00/project-maya#130
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 @judasatan on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/336
Environment
GPU: 2x NVIDIA Tesla V100-SXM2-32GB (Compute Capability 7.0, Volta)
CUDA Version: 12.0
OS: Ubuntu 24.04
Driver: 580.178.04
g++ Version: 13.3.0
Model selected: DeepSeek-V4.1-Flash-1017
Quant format selected: Maya-S (340 GB)
Issue Summary
While attempting to build the engine for DeepSeek-V4.1-Flash-1017 (maya-ds4), the compilation fails completely on a Volta architecture GPU (V100).
The docs/MODELS.md explicitly states that the Maya-S quant for DeepSeek "Runs on NVIDIA from Volta (V100) on". However, the source code for the maya-ds4 engine appears to use CUDA built-in functions that are not available on compute capability 7.0.
Error Log
The build fails during the compilation of maya-ds4 target with the following error:
[83/112] Building CUDA object CMakeFiles/maya-ds4.dir/src/ds4/ds4_kernels.cu.o
FAILED: [code=1] CMakeFiles/maya-ds4.dir/src/ds4/ds4_kernels.cu.o
/usr/bin/nvcc -forward-unknown-to-host-compiler -DSTRATA_NATIVE_EXPERTS=1 -DSTRATA_VERSION="0.1.27" ... -arch=native ...
/data/project-maya/src/ds4/ds4_numerics.cuh(19): error: identifier "_bfloat16_as_ushort" is undefined
1 error detected in the compilation of "/data/project-maya/src/ds4/ds4kernels.cu".
(Note: The same error also occurs for ds4_vision.cu and ds4_gguf.cu)
Root Cause Analysis
The root cause is that hardware-level BF16 (bfloat16) support was introduced in the Ampere architecture (compute capability 8.0). The intrinsic function __bfloat16_as_ushort is used in ds4_numerics.cuh but is not recognized by nvcc when targeting Volta (compute capability 7.0).
It seems the code lacks the proper #if CUDA_ARCH >= 800 preprocessor guards to provide a software fallback (or disable the path) for older architectures like V100.
Steps to Reproduce
Use a machine with an NVIDIA Tesla V100 (or any Volta/Pascal GPU).
Run ./setup.sh --setup
Select 2) DeepSeek-V4.1-Flash-1017 and any quant format.
The setup proceeds to compile the maya-ds4 engine and fails at step 4.
Expected Behavior
The engine should compile successfully on V100 as stated in the documentation, falling back to software emulation for BF16 operations if hardware support is absent.
Possible Fix
Wrap the BF16 intrinsics in ds4_numerics.cuh with #if defined(CUDA_ARCH) && (CUDA_ARCH >= 800) and provide an alternative bitwise manipulation or standard __nv_bfloat16 software fallback for older architectures.
@mw00 commented on GitHub (Oct 22, 2026):
Fixed in v1.1.22: maya-ds4 no longer needs
__bfloat16_as_ushort(CUDA 12.2+), so it builds with CUDA 12.0 / 12.1 on Volta too. Thanks for the detailed report!