Skip to content

Commit

Permalink
Update device-specific config headers with benchmark tuning results (#…
Browse files Browse the repository at this point in the history
…471)

I ran the benchmark tuning code and scripts on the remaining
architectures in our GPU support matrix. This change updates
the config headers with the results.
  • Loading branch information
umfranzw authored Apr 22, 2024
1 parent c710cb6 commit e83dddb
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 33 deletions.
18 changes: 14 additions & 4 deletions library/src/rng/config/lfsr113_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_LFSR113, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 64;
case target_arch::gfx1030: return 64;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 512;
case target_arch::gfx90a: return 64;
case target_arch::gfx908: return 256;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_LFSR113, T>::threads;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_LFSR113, T>::threads;
}
}

Expand All @@ -51,10 +56,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_LFSR113, T>
switch(arch)
{
case target_arch::gfx1102: return 256;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 1024;
case target_arch::gfx1030: return 512;
case target_arch::gfx906: return 2048;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 1024;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_LFSR113, T>::blocks;
case target_arch::gfx906: return 2048;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_LFSR113, T>::blocks;
}
}
};
Expand Down
18 changes: 14 additions & 4 deletions library/src/rng/config/mrg31k3p_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MRG31K3P, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 128;
case target_arch::gfx1030: return 256;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 512;
case target_arch::gfx90a: return 512;
case target_arch::gfx908: return 1024;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG31K3P, T>::threads;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG31K3P, T>::threads;
}
}

Expand All @@ -51,10 +56,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MRG31K3P, T>
switch(arch)
{
case target_arch::gfx1102: return 256;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 1152;
case target_arch::gfx906: return 1792;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 600;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG31K3P, T>::blocks;
case target_arch::gfx906: return 1792;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG31K3P, T>::blocks;
}
}
};
Expand Down
18 changes: 14 additions & 4 deletions library/src/rng/config/mrg32k3a_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MRG32K3A, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 128;
case target_arch::gfx942: return 256;
case target_arch::gfx90a: return 256;
case target_arch::gfx1030: return 256;
case target_arch::gfx906: return 256;
case target_arch::gfx908: return 1024;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG32K3A, T>::threads;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG32K3A, T>::threads;
}
}

Expand All @@ -51,10 +56,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MRG32K3A, T>
switch(arch)
{
case target_arch::gfx1102: return 256;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 2048;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 600;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG32K3A, T>::blocks;
case target_arch::gfx906: return 2048;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MRG32K3A, T>::blocks;
}
}
};
Expand Down
70 changes: 70 additions & 0 deletions library/src/rng/config/mt19937_config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef ROCRAND_RNG_CONFIG_MT19937_CONFIG_HPP_
#define ROCRAND_RNG_CONFIG_MT19937_CONFIG_HPP_

#include "config_defaults.hpp"
#include <rocrand/rocrand.h>

/* DO NOT EDIT THIS FILE
* This file is automatically generated by `/scripts/config-tuning/select_best_config.py`.
*/

namespace rocrand_host::detail
{

template<class T>
struct generator_config_selector<ROCRAND_RNG_PSEUDO_MT19937, T>
{
__host__ __device__ static constexpr unsigned int get_threads(const target_arch arch)
{
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 64;
case target_arch::gfx942: return 128;
case target_arch::gfx90a: return 1024;
case target_arch::gfx908: return 512;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MT19937, T>::threads;
}
}

__host__ __device__ static constexpr unsigned int get_blocks(const target_arch arch)
{
switch(arch)
{
case target_arch::gfx1102: return 256;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 512;
case target_arch::gfx942: return 1024;
case target_arch::gfx90a: return 64;
case target_arch::gfx908: return 64;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MT19937, T>::blocks;
}
}
};

} // end namespace rocrand_host::detail

#endif // ROCRAND_RNG_CONFIG_MT19937_HPP_
18 changes: 14 additions & 4 deletions library/src/rng/config/mtgp32_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MTGP32, T>
switch(arch)
{
case target_arch::gfx1102: return 256;
case target_arch::gfx1101: return 256;
case target_arch::gfx1100: return 256;
case target_arch::gfx1030: return 256;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 256;
case target_arch::gfx90a: return 256;
case target_arch::gfx908: return 256;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MTGP32, T>::threads;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MTGP32, T>::threads;
}
}

Expand All @@ -51,10 +56,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_MTGP32, T>
switch(arch)
{
case target_arch::gfx1102: return 320;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 512;
case target_arch::gfx1030: return 512;
case target_arch::gfx906: return 448;
case target_arch::gfx942: return 512;
case target_arch::gfx90a: return 512;
case target_arch::gfx908: return 480;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_MTGP32, T>::blocks;
case target_arch::gfx906: return 448;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_MTGP32, T>::blocks;
}
}
};
Expand Down
18 changes: 14 additions & 4 deletions library/src/rng/config/philox4_32_10_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>
switch(arch)
{
case target_arch::gfx1102: return 1024;
case target_arch::gfx1101: return 1024;
case target_arch::gfx1100: return 512;
case target_arch::gfx1030: return 1024;
case target_arch::gfx906: return 64;
case target_arch::gfx942: return 1024;
case target_arch::gfx90a: return 512;
case target_arch::gfx908: return 512;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>::threads;
case target_arch::gfx906: return 64;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>::threads;
}
}

Expand All @@ -51,10 +56,15 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 2048;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 896;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 3840;
default: return generator_config_defaults<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>::blocks;
case target_arch::gfx906: return 896;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_PHILOX4_32_10, T>::blocks;
}
}
};
Expand Down
12 changes: 10 additions & 2 deletions library/src/rng/config/threefry2_32_20_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY2_32_20, T>
switch(arch)
{
case target_arch::gfx1102: return 1024;
case target_arch::gfx1101: return 256;
case target_arch::gfx1100: return 1024;
case target_arch::gfx1030: return 256;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 256;
case target_arch::gfx90a: return 512;
case target_arch::gfx908: return 512;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY2_32_20, T>::threads;
}
Expand All @@ -52,9 +56,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY2_32_20, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 2048;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 896;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 1200;
case target_arch::gfx906: return 896;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY2_32_20, T>::blocks;
}
Expand Down
12 changes: 10 additions & 2 deletions library/src/rng/config/threefry2_64_20_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY2_64_20, T>
switch(arch)
{
case target_arch::gfx1102: return 512;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 128;
case target_arch::gfx1030: return 128;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 512;
case target_arch::gfx90a: return 256;
case target_arch::gfx908: return 256;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY2_64_20, T>::threads;
}
Expand All @@ -52,9 +56,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY2_64_20, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 2048;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 560;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 960;
case target_arch::gfx906: return 560;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY2_64_20, T>::blocks;
}
Expand Down
12 changes: 10 additions & 2 deletions library/src/rng/config/threefry4_32_20_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY4_32_20, T>
switch(arch)
{
case target_arch::gfx1102: return 1024;
case target_arch::gfx1101: return 512;
case target_arch::gfx1100: return 1024;
case target_arch::gfx1030: return 1024;
case target_arch::gfx906: return 256;
case target_arch::gfx942: return 1024;
case target_arch::gfx90a: return 256;
case target_arch::gfx908: return 256;
case target_arch::gfx906: return 256;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY4_32_20, T>::threads;
}
Expand All @@ -52,9 +56,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY4_32_20, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 2048;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 896;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 1200;
case target_arch::gfx906: return 896;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY4_32_20, T>::blocks;
}
Expand Down
12 changes: 10 additions & 2 deletions library/src/rng/config/threefry4_64_20_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY4_64_20, T>
switch(arch)
{
case target_arch::gfx1102: return 512;
case target_arch::gfx1101: return 128;
case target_arch::gfx1100: return 128;
case target_arch::gfx1030: return 1024;
case target_arch::gfx906: return 128;
case target_arch::gfx942: return 256;
case target_arch::gfx90a: return 256;
case target_arch::gfx908: return 128;
case target_arch::gfx906: return 128;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY4_64_20, T>::threads;
}
Expand All @@ -52,9 +56,13 @@ struct generator_config_selector<ROCRAND_RNG_PSEUDO_THREEFRY4_64_20, T>
switch(arch)
{
case target_arch::gfx1102: return 128;
case target_arch::gfx1101: return 2048;
case target_arch::gfx1100: return 2048;
case target_arch::gfx1030: return 2304;
case target_arch::gfx906: return 1792;
case target_arch::gfx942: return 2048;
case target_arch::gfx90a: return 2048;
case target_arch::gfx908: return 1920;
case target_arch::gfx906: return 1792;
default:
return generator_config_defaults<ROCRAND_RNG_PSEUDO_THREEFRY4_64_20, T>::blocks;
}
Expand Down
Loading

0 comments on commit e83dddb

Please sign in to comment.