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

Updated CUDA optimiser SM support #627

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/genn/backends/cuda/optimiser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,34 @@
smemAllocGran = 256;
warpAllocGran = 4;
regAllocGran = 256;
maxBlocksPerSM = (deviceProps.minor == 0) ? 32 : 16;
maxBlocksPerSM = (deviceProps.minor == 5) ? 16 : 32;

Check warning on line 128 in src/genn/backends/cuda/optimiser.cc

View check run for this annotation

Codecov / codecov/patch

src/genn/backends/cuda/optimiser.cc#L128

Added line #L128 was not covered by tests
}
else {
else if (deviceProps.major == 8) {
smemAllocGran = 128;
warpAllocGran = 4;
regAllocGran = 256;
maxBlocksPerSM = (deviceProps.minor == 0) ? 32 : 16;

if(deviceProps.major > 8) {
if (deviceProps.minor == 0) {
maxBlocksPerSM = 32;

Check warning on line 136 in src/genn/backends/cuda/optimiser.cc

View check run for this annotation

Codecov / codecov/patch

src/genn/backends/cuda/optimiser.cc#L136

Added line #L136 was not covered by tests
}
else if (deviceProps.minor == 9) {
maxBlocksPerSM = 24;

Check warning on line 139 in src/genn/backends/cuda/optimiser.cc

View check run for this annotation

Codecov / codecov/patch

src/genn/backends/cuda/optimiser.cc#L139

Added line #L139 was not covered by tests
}
else {
maxBlocksPerSM = 16;
}
}
else {
smemAllocGran = 128;
warpAllocGran = 4;
regAllocGran = 256;
maxBlocksPerSM = 32;
if(deviceProps.minor != 0) {
LOGW_BACKEND << "Unsupported CUDA device version: 9." << deviceProps.minor;
LOGW_BACKEND << "This is a bug! Please report it at https://github.com/genn-team/genn.";
LOGW_BACKEND << "Falling back to SM 9.0 parameters.";

Check warning on line 153 in src/genn/backends/cuda/optimiser.cc

View check run for this annotation

Codecov / codecov/patch

src/genn/backends/cuda/optimiser.cc#L146-L153

Added lines #L146 - L153 were not covered by tests
}
if(deviceProps.major > 9) {

Check warning on line 155 in src/genn/backends/cuda/optimiser.cc

View check run for this annotation

Codecov / codecov/patch

src/genn/backends/cuda/optimiser.cc#L155

Added line #L155 was not covered by tests
LOGW_BACKEND << "Unsupported CUDA device major version: " << deviceProps.major;
LOGW_BACKEND << "This is a bug! Please report it at https://github.com/genn-team/genn.";
LOGW_BACKEND << "Falling back to next latest SM version parameters.";
Expand Down