Repository navigation
Fix pin for pytorch, build CPU, GPU kernels - #132
Conversation
… 2026.11.02.15.51.50 Other tools: - conda-build 26.3.0 - rattler-build 0.74.0 - rattler-build-conda-compat 1.4.19
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
- Force DS_ACCELERATOR=cuda in CUDA builds. Without a GPU on CI, DeepSpeed fell back to the CPU accelerator, so the CUDA packages shipped no CUDA kernels. Skip cutlass_ops/ragged_device_ops (need deepspeed-kernels) and evoformer_attn (needs CUTLASS); add libcufile-dev for gds; use ninja. - Skip deepspeed_ccl_comm in all variants and drop oneccl-devel. - Patch fp_quantizer so nvcc doesn't reject redeclaring a template parameter, keeping the semantics nvcc 12 compiled. - Generalise the ops test to cpu/cuda and set DS_ACCELERATOR explicitly (osx-arm64 would otherwise pick mps).
|
@conda-forge/deepspeed, this is ready |
weiji14
left a comment
There was a problem hiding this comment.
Thanks @isuruf, I haven't been using deepspeed for a long while, so good to have someone make sure things are built correctly (instead of me just pushing buttons when CI is green). Just a couple of questions for now, would appreciate it if @loadams (actual DeepSpeed dev) gives this a proper review, and maybe consider getting some of the patches here upstreamed.
| # The op builders default to -march=native and pick SIMD intrinsics from the | ||
| # build machine's CPU flags. Use portable settings instead (see patch 0001). | ||
| # Leave -march to the compiler flags from conda-forge's activation scripts. | ||
| export DS_CPU_ARCH="" | ||
| case ${target_platform} in | ||
| linux-64) | ||
| # conda-forge's x86_64 baseline has no AVX, so use the scalar code path | ||
| export DS_SIMD_WIDTH="-D__SCALAR__" | ||
| ;; | ||
| linux-aarch64|osx-arm64) | ||
| # NEON is part of the AArch64 baseline | ||
| export DS_SIMD_WIDTH="-D__NEON__" | ||
| ;; | ||
| *) |
There was a problem hiding this comment.
Should microarch levels be declared then on this feedstock? Also, are you forcing scalar instructions always on x86_64, instead of letting Deespeed's simd_width() function pick which SIMD instructions to build for?
There was a problem hiding this comment.
Yes, but I'll leave it to another PR
| + # Allow packagers to override the detected CPU architecture flag so that | ||
| + # pre-compiled ops are not tied to the build machine (-march=native). | ||
| + # An empty value means no -march/-mcpu flag is added. | ||
| + if os.environ.get("DS_CPU_ARCH") is not None: | ||
| + return os.environ["DS_CPU_ARCH"] |
There was a problem hiding this comment.
Can you elaborate on why this override is needed? We're not doing cross-compilation to linux-aarch64 (yet), and as far as I'm aware, the osx-arm64 CI builds should be on native hardware?
There was a problem hiding this comment.
-march=native makes the build depend on the build machine. If the build machine had avx512, we would get one. This removes -march=native because of that.
|
One more comment. but on the GPU CI, they show up as NO (unsure if it's because there's no GPU on CI), https://github.com/conda-forge/deepspeed-feedstock/actions/runs/41900411813/job/126820978864?pr=132#step:5:13056: I should probably test this locally on my GPU, but just want to point this out in case it's helpful. |
|
@weiji14, this is what I get from a machine with a CUDA GPU |
weiji14
left a comment
There was a problem hiding this comment.
@weiji14, this is what I get from a machine with a CUDA GPU
Cool, I can verify this locally on my end too (building on CUDA 13)
Details
$ ds_report
--------------------------------------------------
DeepSpeed C++/CUDA extension op report
--------------------------------------------------
NOTE: Ops not installed will be just-in-time (JIT) compiled at
runtime if needed. Op compatibility means that your system
meet the required dependencies to JIT install the op.
--------------------------------------------------
JIT compiled ops requires ninja
ninja .................. [FAIL]
--------------------------------------------------
op name ................ installed .. compatible
--------------------------------------------------
[WARNING] async_io requires the dev libaio .so object and headers but these were not found.
[WARNING] async_io: please install the libaio-dev package with apt
[WARNING] If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
async_io ............... [YES] ...... [NO]
fused_adam ............. [YES] ...... [OKAY]
cpu_adam ............... [YES] ...... [OKAY]
cpu_adagrad ............ [YES] ...... [OKAY]
cpu_lion ............... [YES] ...... [OKAY]
pin_memory ............. [YES] ...... [OKAY]
dc ..................... [YES] ...... [OKAY]
[WARNING] Unable to locate CUTLASS. Install nvidia-cutlass, clone CUTLASS next to DeepSpeed, or set CUTLASS_PATH to the CUTLASS checkout.
evoformer_attn ......... [NO] ....... [NO]
fp_quantizer ........... [YES] ...... [OKAY]
fused_lamb ............. [YES] ...... [OKAY]
fused_lion ............. [YES] ...... [OKAY]
/home/weiji/mambaforge/envs/temp/bin/x86_64-conda-linux-gnu-ld: cannot find -lcufile: No such file or directory
collect2: error: ld returned 1 exit status
gds .................... [YES] ...... [NO]
transformer_inference .. [YES] ...... [OKAY]
inference_core_ops ..... [YES] ...... [OKAY]
cutlass_ops ............ [NO] ....... [OKAY]
utils .................. [YES] ...... [OKAY]
transformer ............ [YES] ...... [OKAY]
quantizer .............. [YES] ...... [OKAY]
spatial_inference ...... [YES] ...... [OKAY]
ragged_device_ops ...... [NO] ....... [OKAY]
ragged_ops ............. [YES] ...... [OKAY]
random_ltd ............. [YES] ...... [OKAY]
stochastic_transformer . [YES] ...... [OKAY]
--------------------------------------------------
DeepSpeed general environment info:
torch install path ............... ['/home/user/mambaforge/envs/temp/lib/python3.14/site-packages/torch']
torch version .................... 2.14.1
deepspeed install path ........... ['/home/user/mambaforge/envs/temp/lib/python3.14/site-packages/deepspeed']
deepspeed info ................... 0.19.9, 465abda, ops
torch cuda version ............... 13.4
torch hip version ................ None
nvcc version ..................... 13.5
deepspeed wheel compiled w. ...... torch 2.14, cuda 13.4
shared memory (/dev/shm) size .... 15.52 GB
and have also tested the output of $ python recipe/test_ops.py cuda:
installed_ops: {'async_io': 1, 'fused_adam': 1, 'cpu_adam': 1, 'cpu_adagrad': 1, 'cpu_lion': 1, 'pin_memory': 1, 'dc': 1, 'evoformer_attn': False, 'fp_quantizer': 1, 'fused_lamb': 1, 'fused_lion': 1, 'gds': 1, 'transformer_inference': 1, 'inference_core_ops': 1, 'cutlass_ops': False, 'utils': 1, 'transformer': 1, 'quantizer': 1, 'spatial_inference': 1, 'ragged_device_ops': False, 'ragged_ops': 1, 'random_ltd': 1, 'stochastic_transformer': 1}
torch_info: {'version': '2.14', 'bf16_support': False, 'cuda_version': '13.4', 'nccl_version': '2.32', 'hip_version': '0.0'}
loaded async_io
loaded cpu_adagrad
loaded cpu_adam
loaded cpu_lion
loaded dc
loaded fp_quantizer
loaded fused_adam
loaded fused_lamb
loaded fused_lion
loaded gds
loaded inference_core_ops
loaded pin_memory
loaded quantizer
loaded ragged_ops
loaded random_ltd
loaded spatial_inference
loaded stochastic_transformer
loaded transformer
loaded transformer_inference
loaded utils
Thanks again for applying the fixes and adding tests too! I'll merge this in now 🚀
Checklist
0(if the version changed)conda-smithy(Use the phrase@conda-forge-admin, please rerenderin a comment in this PR for automated rerendering)Previously CPU packages didn't have any compiled kernels and the GPU packages had only CPU kernels compiled in and no GPU kernels compiled.