[Fix] Fix compile error by HAOCHENYE 路 Pull Request #4357 路 hpcaitech/ColossalAI (original) (raw)
馃搶 Checklist before creating the PR
- I have created an issue for this PR for traceability
- The title follows the standard format:
[doc/gemini/tensor/...]: A concise description
- I have added relevant tags if possible for us to better distinguish different PRs
馃毃 Issue number
Link this PR to your issue with words like fixed to automatically close the linked issue upon merge
e.g.
fixed #1234
,closed #1234
,resolved #1234
馃摑 What does this PR do?
torch.cuda.get_arch_list()
here:
for arch in torch.cuda.get_arch_list(): |
---|
will get the available GPU arch for the current PyTorch lib. For example, the PyTorch 2.0 is built by the hopper arch GPU, it will return a list:
['sm_37', 'sm_50', 'sm_60', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'sm_90']
However, my GPU is an ampere arch GPU, return a list includes sm_90
here will cause an compile error like:
nvcc fatal : Unsupported gpu architecture 'compute_90'.
Therefore, I think the valid arch returned here should be >= sm60
but <= sm86
, which is the max available arch for my GPU
馃挜 Checklist before requesting a review
- I have linked my PR to an issue (instruction)
- My issue clearly describes the problem/feature/proposal, with diagrams/charts/table/code if possible
- I have performed a self-review of my code
- I have added thorough tests.
- I have added docstrings for all the functions/methods I implemented
猸愶笍 Do you enjoy contributing to Colossal-AI?
- 馃対 Yes, I do.
- 馃寶 No, I don't.
Tell us more if you don't enjoy contributing to Colossal-AI.