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

Improve compile time (simple makefile changes) #738

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

ademeure
Copy link
Contributor

@ademeure ademeure commented Aug 12, 2024

This improves compile times by:

  1. Using nvidia-smi instead of __nvcc_device_query (the latter was wasting >1 second per build on a 1xH100 system!)
  2. "--threads=0" allowss NVCC to use multithreading for some things (seems to improve compile times by ~5% locally.)
  3. Making -O3 configurable with the FORCE_NVCC_O parameter (O0 improves compile times by >30% but significantly hurts run times; -O1 seems like a good compromise when iterating on some code.)

(1) and (2) reduce compile time with cuDNN from ~9.2s to ~8.1s.
(3) with O2/O1/O0 reduces it further to ~7.7s / ~6.5s / ~5.4s.

@karpathy
Copy link
Owner

nice!

@karpathy
Copy link
Owner

surprised about both 1 and 2...

@karpathy karpathy merged commit 1787210 into karpathy:master Aug 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants