mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #56] How to bind gpu_id? #34
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#34
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 @Jocx-H on GitHub (Mar 11, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/56
My server has multiple GPUs, including A100 and H100. How should I specify H100 in test_core.py? When I use the following command, an error occurs:
gpu_id = 4
os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu_id)
torch.cuda.set_device(gpu_id)
print(torch.cuda.current_device())
print(torch.cuda.get_device_name(4))
4
NVIDIA H100 PCIe
Library path:
Testing GEMM:
Traceback (most recent call last):
File "tests/test_core.py", line 164, in
test_gemm()
File "tests/test_core.py", line 78, in test_gemm
deep_gemm.gemm_fp8_fp8_bf16_nt(x_fp8, y_fp8, out)
File "/path/to/DeepGEMM/deep_gemm/jit_kernels/gemm.py", line 153, in gemm_fp8_fp8_bf16_nt
num_sms = get_num_sms()
File "/path/to/DeepGEMM/deep_gemm/jit_kernels/utils.py", line 28, in get_num_sms
_num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count
File "/path/to/lib/python3.8/site-packages/torch/cuda/init.py", line 452, in get_device_properties
raise AssertionError("Invalid device id")
AssertionError: Invalid device id
I don't know why this happens