Repository navigation
Benchmarks: Fix cuDNN storage/compute types and FP16 initialization #852
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
base: main
Are you sure you want to change the base?
Changes from all commits
cb4a497
6e964cc
bb7391a
611a96d
a885635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ class CudnnConfig { | |
| void set_mode(const cudnnConvolutionMode_t &mode) { mode_ = mode; } | ||
| void set_use_tensor_op(bool use_tensor_op) { use_tensor_op_ = use_tensor_op; } | ||
| void set_input_type(const cudnnDataType_t &input_type) { input_type_ = input_type; } | ||
| void set_conv_type(const cudnnDataType_t &conv_type) { input_type_ = conv_type; } | ||
| void set_conv_type(const cudnnDataType_t &conv_type) { conv_type_ = conv_type; } | ||
| void set_function(const std::string &str) { function_str_ = str; } | ||
| void set_auto_algo(bool auto_algo) { auto_algo_ = auto_algo; } | ||
|
|
||
|
|
@@ -96,7 +96,7 @@ class CudnnConfig { | |
| cudnnConvolutionMode_t &get_mode() { return mode_; } | ||
| bool get_use_tensor_op() { return use_tensor_op_; } | ||
| cudnnDataType_t &get_input_type() { return input_type_; } | ||
| cudnnDataType_t &get_conv_type() { return input_type_; } | ||
| cudnnDataType_t &get_conv_type() { return conv_type_; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NON-BLOCKING]
Impact: Historical baselines and diagnosis rules will show a step change that looks like a regression or improvement. Recommendation: Add a release note naming the affected metrics and the revision boundary, and refresh the stored cudnn-function baselines. |
||
| std::string &get_name() { return name; } | ||
| cudnn_function_name_enum get_e_name() { return e_name; } | ||
| std::string &get_function_str() { return function_str_; } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,10 +77,11 @@ template <> void rand(half **input, std::vector<int> dims_, int random_seed) { | |
| CUDA_SAFE_CALL(cudaMalloc((void **)input, sizeof(half) * size)); | ||
| half *host_input; | ||
| CUDA_SAFE_CALL(cudaMallocHost(&host_input, sizeof(half) * size)); | ||
| srand(random_seed); | ||
| for (int i = 0; i < size; i++) { | ||
| host_input[i] = __float2half((float)std::rand() / (float)(RAND_MAX)); | ||
| } | ||
| CUDA_SAFE_CALL(cudaMemcpy(host_input, *input, sizeof(half) * size, cudaMemcpyHostToDevice)); | ||
| CUDA_SAFE_CALL(cudaMemcpy(*input, host_input, sizeof(half) * size, cudaMemcpyHostToDevice)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [SHOULD-FIX] Default FP16 path becomes live but has no GPU validation or type-separation regression test Nine default configs in Impact: If any default half/float algo or tensor-op combination is unsupported, it yields a -1 timing that only shows up on GPU CI or in production runs. Recommendation:
|
||
| CUDA_SAFE_CALL(cudaFreeHost(host_input)); | ||
| } | ||
| } // namespace cudnn_test | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SHOULD-FIX] Unsupported inputType/convType pairs now abort via an uncaught
const char*With this change,
run_benchmark(cudnn_function_helper.h) sees the real(input_type, conv_type)pair. Before,set_conv_typeoverwroteinput_type_, so the finalelsebranch was unreachable. Now pairs such asinputType 0, convType 2reach:That throws a
const char*. Bothrun_benchmarkandmainin cudnn_test.cpp onlycatch (std::exception &e), so the process callsstd::terminate(SIGABRT) and prints noError:line.Impact: Custom configs that previously ran (with the wrong types) now abort without a diagnostic. The Python wrapper records only a generic execution failure.
Recommendation:
Apply the same fix to the sibling
throw "invalid function name"/throw "ERROR: invalid input function name".