Instructions to use replicate/aiter-kernels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/aiter-kernels with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/aiter-kernels", version=1) - Notebooks
- Google Colab
- Kaggle
Download build/torch-rocm/utils/device_info.py from replicate/aiter-kernels: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/replicate/aiter-kernels/resolve/main/build/torch-rocm/utils/device_info.py
- Command line
-
hf download hf://replicate/aiter-kernels/build/torch-rocm/utils/device_info.py
-
curl -L -o device_info.py https://huggingface.co/replicate/aiter-kernels/resolve/main/build/torch-rocm/utils/device_info.py
437 Bytes
| import torch | |
| def get_num_sms(): | |
| # Returns the Compute Unit count of the current device | |
| current_device_index = torch.cuda.current_device() | |
| current_device = torch.cuda.get_device_properties(current_device_index) | |
| num_sms = current_device.multi_processor_count | |
| return num_sms | |
| def get_num_xcds(): | |
| # Currently, you can't query this programmatically. For gfx942/gfx950 it's 8, so we hardcode that here. | |
| return 8 | |