diff --git a/src/targets/gpu/gemm_impl.cpp b/src/targets/gpu/gemm_impl.cpp index a257fdba0e2..22c839e49b5 100644 --- a/src/targets/gpu/gemm_impl.cpp +++ b/src/targets/gpu/gemm_impl.cpp @@ -311,11 +311,13 @@ struct gemm_impl { // Create dummy arguments for the shapes, and call the overloaded method std::vector input_args; + unsigned long seed = 0; std::transform(input_shapes.begin(), input_shapes.end(), std::back_inserter(input_args), - [](const shape& x) { return to_gpu(generate_argument(x)); }); - + [&](const shape& x) { + return to_gpu(generate_argument(x, seed++, random_mode::random)); + }); return validate(ctx, input_args, solution_idx); } @@ -448,12 +450,14 @@ struct gemm_impl { // tuning meta parameters const int hot_calls = 40; - + unsigned long seed = 0; std::vector input_args; std::transform(input_shapes.begin(), input_shapes.end(), std::back_inserter(input_args), - [](const shape& x) { return to_gpu(generate_argument(x)); }); + [&](const shape& x) { + return to_gpu(generate_argument(x, seed++, random_mode::random)); + }); // Get the solutions list in 2 rocBLAS steps: // 1. Find out how many solutions there are and allocate the array diff --git a/src/targets/gpu/include/migraphx/gpu/convolution.hpp b/src/targets/gpu/include/migraphx/gpu/convolution.hpp index 1b1c3169830..1a6d1bc2497 100644 --- a/src/targets/gpu/include/migraphx/gpu/convolution.hpp +++ b/src/targets/gpu/include/migraphx/gpu/convolution.hpp @@ -180,6 +180,7 @@ struct miopen_convolution const auto& x_shape = inputs[0]; const auto& w_shape = inputs[1]; + unsigned long seed = 0; #ifdef MIGRAPHX_HAS_FIND_2_API { auto conv_problem = make_obj( @@ -192,8 +193,10 @@ struct miopen_convolution // MIOpen has APIs to pass pre-allocated buffers starting from rocm-5.6 preallocate = true; #endif - auto x = preallocate ? to_gpu(generate_argument(x_shape)) : argument{inputs[0]}; - auto w = preallocate ? to_gpu(generate_argument(w_shape)) : argument{inputs[1]}; + auto x = preallocate ? to_gpu(generate_argument(x_shape, seed++, random_mode::random)) + : argument{inputs[0]}; + auto w = preallocate ? to_gpu(generate_argument(w_shape, seed++, random_mode::random)) + : argument{inputs[1]}; auto y = preallocate ? allocate_gpu(output_shape) : argument{inputs[2]}; auto workspace = preallocate ? allocate_gpu(workspace_shape) : migraphx::argument(workspace_shape); @@ -233,8 +236,8 @@ struct miopen_convolution return shape{shape::int8_type, {workspace_size}}; } #else - auto x = to_gpu(generate_argument(x_shape)); - auto w = to_gpu(generate_argument(w_shape)); + auto x = to_gpu(generate_argument(x_shape, seed++, random_mode::random)); + auto w = to_gpu(generate_argument(w_shape, seed++, random_mode::random)); auto y = allocate_gpu(output_shape); auto workspace = allocate_gpu(workspace_shape); int algo_count = 1;