Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensor cores - enabled -> as a flag? #8

Open
1 of 3 tasks
jere357 opened this issue Dec 11, 2023 · 2 comments
Open
1 of 3 tasks

Tensor cores - enabled -> as a flag? #8

jere357 opened this issue Dec 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jere357
Copy link
Contributor

jere357 commented Dec 11, 2023

You are using a CUDA device ('NVIDIA GeForce RTX 3060') that has Tensor Cores. To properly utilize them, you should set torch.set_float32_matmul_precision('medium' | 'high') which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision

  • write some code that detects tensor core GPUs and sets this matmul precision?
  • benchmark things with this and without this
  • decide if this is another flag for the docker run command
@jere357 jere357 changed the title what to do about this Tensor cores - enabled or not Dec 12, 2023
@jere357 jere357 changed the title Tensor cores - enabled or not Tensor cores - enabled -> as a flag? Dec 12, 2023
@jere357
Copy link
Contributor Author

jere357 commented Dec 13, 2023

I ran 4 experiments on our ada6k, training vit_l_16 with different setups, trying to see how much this flags helps. Seems to be significant only for --precision 32 training.

float32_matmul_precision --precision img/s
highest (default) 32 47
highest (default) 16-mixed 177
high 32 94
high 16-mixed 176

@bfreskura
Copy link
Contributor

@jere357 Can you create a PR for this?

@bfreskura bfreskura added the enhancement New feature or request label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants