You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

competition_parallel_algorithms.md 2.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # 题目:
  2. ## GPU高性能并行计算算法优化
  3. 要求参赛者通过一个或多个global kernel 函数(允许配套 device 辅助函数),实现高性能算法。
  4. 在正确性、稳定性前提下,比拼算法性能。
  5. # 1. ReduceSum算法优化
  6. ```cpp
  7. template <typename InputT = float, typename OutputT = float>
  8. class ReduceSumAlgorithm {
  9. public:
  10. // 主要接口函数 - 参赛者需要实现这个函数
  11. void reduce(const InputT* d_in, OutputT* d_out, int num_items, OutputT init_value) {
  12. // TODO
  13. }
  14. };
  15. ```
  16. 其中
  17. * 数据类型:InputT: float, OutputT: float
  18. * 系统将测试评估1M, 128M, 512M, 1G element number下的算法性能
  19. * 假定输入d\_in数据量为num\_items
  20. 注意事项
  21. * 累计误差不大于cpu double golden基准的0.5%
  22. * 注意针对NAN和INF等异常值的处理
  23. 加分项
  24. * 使用tensor core计算reduce
  25. * 覆盖更全面的数据范围,提供良好稳定的性能表现
  26. # 2. Sort Pair算法优化
  27. ```cpp
  28. template <typename KeyType, typename ValueType>
  29. class SortPairAlgorithm {
  30. public:
  31. // 主要接口函数 - 参赛者需要实现这个函数
  32. void sort(const KeyType* d_keys_in, KeyType* d_keys_out,
  33. const ValueType* d_values_in, ValueType* d_values_out,
  34. int num_items, bool descending) {
  35. // TODO
  36. }
  37. };
  38. ```
  39. 其中
  40. * 数据类型:key: float, value: int32\_t
  41. * 系统将测试评估1M, 128M, 512M, 1G element number下的算法性能
  42. * 假定输入、输出的key和value的数据量一致,均为num\_items
  43. 注意事项
  44. * 需要校验结果正确性
  45. * 结果必须稳定排序
  46. 加分项
  47. * 支持其他不同数据类型的排序,如half、double、int32_t等
  48. * 覆盖更全面的数据范围,提供良好稳定的性能表现
  49. # 3. Topk Pair算法优化
  50. ```cpp
  51. template <typename KeyType, typename ValueType>
  52. class TopkPairAlgorithm {
  53. public:
  54. // 主要接口函数 - 参赛者需要实现这个函数
  55. void topk(const KeyType* d_keys_in, KeyType* d_keys_out,
  56. const ValueType* d_values_in, ValueType* d_values_out,
  57. int num_items, int k, bool descending) {
  58. // TODO
  59. }
  60. };
  61. ```
  62. 其中
  63. * 数据类型:key: float, value: int32\_t
  64. * 系统将测试评估1M, 128M, 512M, 1G element number下的算法性能
  65. * 假定输入的key和value的数据量一致,为num\_items;输出的key和value的数据量一致,为k
  66. * k的范围:32,50,100,256,1024。k不大于num\_items
  67. 注意事项
  68. * 结果必须稳定排序
  69. 加分项
  70. * 支持其他不同数据类型的键值对,实现类型通用算法
  71. * 覆盖更全面的数据范围,提供良好稳定的性能表现