MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / vector_kernel_level

Function vector_kernel_level

csrc/cpu/comm/shm_interface.cpp:108–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int vector_kernel_level()
109{
110#if defined(__x86_64__)
111 // The bf16/fp16 reduce kernels are compiled with target("avx512bw") and use
112 // _mm512_* conversions; the fp32 kernels only use 256-bit AVX. Executing an
113 // unsupported ISA level faults, and the fault surfaces downstream as a hang
114 // once the peers block on the shm synchronization flags.
115 if (__builtin_cpu_supports("avx512bw")) return 2;
116 if (__builtin_cpu_supports("avx2")) return 1;
117 return 0;
118#else
119 // The arm64/riscv ports have no runtime ISA probe, so keep the pre-guard
120 // behavior of always enabling them; stricter gating for their optional
121 // extensions (e.g. riscv +v/+zvfh) is left to those ports' maintainers.
122 return 2;
123#endif
124}
125
126PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
127{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected