Skip to content

setup.py: fix wheel building - #19

Merged
LyricZhao merged 1 commit into
deepseek-ai:mainfrom
dzhulgakov:fix-wheel
Feb 27, 2025
Merged

LyricZhao merged 1 commit into
deepseek-ai:mainfrom
dzhulgakov:fix-wheel

Conversation

@dzhulgakov

Copy link
Copy Markdown
Contributor

Existing PostInstallCommand works for setup.py install but not for setup.py bdist_wheel which is useful for prebuilding packages.

@LyricZhao
LyricZhao merged commit 676329b into deepseek-ai:main Feb 27, 2025
@yz-tang

yz-tang commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

@dzhulgakov
I suspect there is something wrong with this build:
root@7cc7134dae2f:~/work/DeepGEMM# python3 tests/test_core.py
Library path:

['/usr/local/lib/python3.10/dist-packages/deep_gemm']

Testing GEMM:
Traceback (most recent call last):
File "/root/work/DeepGEMM/tests/test_core.py", line 156, in
test_gemm()
File "/root/work/DeepGEMM/tests/test_core.py", line 70, in test_gemm
deep_gemm.gemm_fp8_fp8_bf16_nt(x_fp8, y_fp8, out)
File "/usr/local/lib/python3.10/dist-packages/deep_gemm/jit_kernels/gemm.py", line 156, in gemm_fp8_fp8_bf16_nt
runtime = jit_tuner.compile_and_tune(
File "/usr/local/lib/python3.10/dist-packages/deep_gemm/jit_kernels/tuner.py", line 40, in compile_and_tune
kernels.append((build(name, arg_defs, code), tuned_keys))
File "/usr/local/lib/python3.10/dist-packages/deep_gemm/jit/compiler.py", line 110, in build
signature = f'{name}$${get_deep_gemm_version()}$${code}$${get_nvcc_compiler()}$${flags}$${enable_sass_opt}'
File "/usr/local/lib/python3.10/dist-packages/deep_gemm/jit/compiler.py", line 32, in get_deep_gemm_version
assert os.path.exists(include_dir), f'Cannot find GEMM include directory {include_dir}'
AssertionError: Cannot find GEMM include directory /usr/local/lib/python3.10/dist-packages/deep_gemm/jit/../include/deep_gemm

@LyricZhao

LyricZhao commented Mar 4, 2025 •

Copy link
Copy Markdown
Collaborator

@yz-tang I will find another internal colleague to follow and fix this. Thanks for your feedback!

@yz-tang

yz-tang commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

@LyricZhao Iim trying to fix this, PR: #36

LyricZhao added a commit that referenced this pull request Apr 16, 2026
* feat: unify k grouped gemm

* fix template compiling issue

* fix bugs

* Some renaming

* Some renaming x2

* Less loads

* Fix stage count

* Enable multicast

* Fix benchmark

* Simplify phases

* Optimize performance

* Optimize CPU overhead

---------

Co-authored-by: Zhean Xu <[email protected]>
Co-authored-by: Chenggang Zhao <[email protected]>
cleonard530 pushed a commit to cleonard530/DeepGEMM that referenced this pull request Sep 28, 2026
NVFP4 MegaMoE applies only a per-expert L1 alpha, so every routed input
row shares one tensor-wide activation global scale. Add optional
per-token FP32 outer scales for the L1 input (`use_x_scales=True`,
written to `NVFP4SymmBuffer.x_scales`): dispatch carries each token's
scale to its expert ring slot next to the top-k weight, and the L1
epilogue multiplies it into the accumulator together with `l1_alpha`,
before BF16 rounding, the clamp and the activation.

The two scale buffers are appended to the symmetric buffer layout, so
existing offsets do not move. `kUseXScales` is a template flag; with it
off the generated kernel is unchanged.

Signed-off-by: Yongye Zhu <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants