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

Fix 20x slowdown of FP6 kernel due to device properties query #1092

Merged
merged 1 commit into from
Oct 16, 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
17 changes: 8 additions & 9 deletions torchao/csrc/cuda/fp6_llm/fp6_linear.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@
inline bool isSM75GPU() {
int device;
cudaError_t err = cudaGetDevice(&device);
if (err != cudaSuccess) {
return false;
}
if (err != cudaSuccess) return false;

cudaDeviceProp props;
err = cudaGetDeviceProperties(&props, device);
if (err != cudaSuccess) {
return false;
}
int major, minor;
err = cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, device);
if (err != cudaSuccess) return false;

err = cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, device);
if (err != cudaSuccess) return false;

return (props.major == 7) && (props.minor == 5);
return (major == 7) && (minor == 5);
}

template<typename TilingConfig, typename OutputDataType, int EXPONENT, int MANTISSA>
Expand Down
Loading