Commit Graph

1113 Commits

Author SHA1 Message Date
Jun Liu
d29b1436fb ROCm 6.0 replaces all __HIP_PLATFORM_HCC__ with __HIP_PLATFORM_AMD__ (#1106)
* ROCm 6.0 replaces all __HIP_PLATFORM_HCC__ with __HIP_PLATFORM_AMD__

* make it backward compatible

* Update .clang-tidy

* Update ClangTidy.cmake

[ROCm/composable_kernel commit: 3ab1838fb0]
2023-12-19 07:16:49 -08:00
Illia Silin
d7a9aeeab6 add -Wno-pass-failed compiler flag (#1105)
[ROCm/composable_kernel commit: 3726a1730e]
2023-12-19 07:15:24 -08:00
arai713
4a08e49813 Hip tensor permute unit test (#1068)
* adding files for F32 example

* adding functioning implementation with scalar multiplication and unary operator support

* added fp 16 type check in unary square

* updating scalar multiplication as an operator

* functioning version with scalar operator

* changing strides for col major

* updated column major implementation

* working column major implementation

* cleaned up comments, rearranged/renamed files

* small edits to 3d transpose profiler

* adding test/profiler/instance files for hipTensor permute unit test

* added more test instances

* cleaned up errors, randomized input tensor, added more instances

* turned off time printouts

* removed conflicting transpose profiler

* rearranged some files

[ROCm/composable_kernel commit: 12a8883c48]
2023-12-18 21:35:00 -06:00
rocking
599986035e layernorm and groupnorm backward data (#1083)
* rename folder

* Add type string

* Remove typo

* Add deviceOp to backward x

* Add comment to describe the behavior of backward normalization

* Add kernel function, prepare to implement

* implement generic kernel

* Check vector size

* Add sweep once pipeline for small reduce size

* Fix bug of KRaw_ error

* Fix bug of dx stride

* sanity check for mean and rstd

* backward x for groupnorm

* Add bwd x instance

* add layernorm 2d bwd gamma beta instances

* Change save mean var type from f32 to f16 in f16 mode

* Change the example to f16

* Add groupnorm bwd gamma beta instance

* Add groupnorm bwd x instance

* Fix naming

* Add layernorm bwd x ckprofiler

* Add groupnorm bwd x profiler

* clang format

* Rename bwd x to bwd data

* Fix bug of verification in profiler

* Add test of layernorm and groupnorm bwd data

* Add missing cmake

* Add layernorm2d bwd data

* rename fwd example

* Add groupnorm client example

* Fix typo. replace Invarient with Invariant

* Add checking before running the best instance

[ROCm/composable_kernel commit: a69aa2a11a]
2023-12-19 04:23:11 +08:00
Bartlomiej Wroblewski
1c061c9b1d Optimize fp16 direct load GEMM instances (#1086)
This PR optimizes fp16 instances of direct load GEMM kernel introduced in #999 and #1052.

Measured the performance of new instances on CDNA2 GPU and compared it against the performance of the best non-direct-load GEMM instances. Used 76 different GEMM problems.
On average, this change improves the performance of the tested problems by 47%. For cases known as latency-bound, the speedup is around 126%.

[ROCm/composable_kernel commit: ad0a8e4cd2]
2023-12-18 11:09:10 +01:00
Illia Silin
8970025d28 Upgrade the default compiler to ROCm6.0 release. (#1103)
* upgrade to rocm6.0 compiler

* move rocm6.0 from private to public repo

* switch to testing hipTensor mainline in CI

[ROCm/composable_kernel commit: dcedf3632f]
2023-12-16 09:17:40 -08:00
abhimeda
5e35659622 Adding Issue Template (#1094)
* Add files via upload

* fixed extra space typo

* add mi300 GPU architectures and rocm versions 5.6.1 and 6.0.0

---------

Co-authored-by: illsilin <Illia.Silin@amd.com>
Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>

[ROCm/composable_kernel commit: 3246d1f693]
2023-12-15 09:41:35 -08:00
Bartłomiej Kocot
29122919de Add tensor structure to wrapper (#1098)
* Add tensor structure to wrapper

* update changelog

* Fix names

* Comment fixes

[ROCm/composable_kernel commit: 07092d68f0]
2023-12-15 12:45:08 +01:00
trixirt
04d5dfa382 cmake: Add CK_PARALLEL_LINK_JOBS and CK_PARALLEL_COMPILE_JOBS options (#1063)
Copied from the llvm-project LLVM_PARALLEL_*_JOBS

Concurrent linking can break the build as well as having too many
compile jobs for the avaiable memory.  These options allow the user
to fine tune the build to fit within their machines memory
constraints.

An example use on linux is
COMPILE_JOBS=`cat /proc/cpuinfo | grep -m 1 'cpu cores' | awk '{ print $4 }'`
if [ ${COMPILE_JOBS}x = x ]; then
  COMPILE_JOBS=1
fi
BUILD_MEM=4
MEM_KB=0
MEM_KB=`cat /proc/meminfo | grep MemTotal | awk '{ print $2 }'`
MEM_MB=`eval "expr ${MEM_KB} / 1024"`
MEM_GB=`eval "expr ${MEM_MB} / 1024"`
COMPILE_JOBS_MEM=`eval "expr 1 + ${MEM_GB} / ${BUILD_MEM}"`
if [ "$COMPILE_JOBS_MEM" -lt "$COMPILE_JOBS" ]; then
  COMPILE_JOBS=$COMPILE_JOBS_MEM
fi
LINK_MEM=32
LINK_JOBS=`eval "expr 1 + ${MEM_GB} / ${LINK_MEM}"`

cmake -G Ninja -DCK_PARALLEL_LINK_JOBS=$LINK_JOBS
               -DCK_PARALLEL_COMPILE_JOBS=$COMPILE_JOBS

Signed-off-by: Tom Rix <trix@redhat.com>

[ROCm/composable_kernel commit: efaf31061a]
2023-12-14 17:26:41 -08:00
Lisa
347d19ece9 fix typo (#1067)
Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>

[ROCm/composable_kernel commit: 281f836903]
2023-12-14 14:21:18 -08:00
Jun Liu
c6d3fd0e52 [Doc][Werror] Fix security alerts and sync with MIOpen (#1085)
* fix Werror unused-parameter

* sync doc requirements

* fix blank space format

* fix dependency issue

[ROCm/composable_kernel commit: 3a3b98ef79]
2023-12-13 12:50:15 -08:00
Rostyslav Geyyer
08754a58e4 Fix the bugs (#1099)
[ROCm/composable_kernel commit: 6891e4d109]
2023-12-13 12:27:31 -08:00
Illia Silin
8fc96b3569 disabling some fp8 gemm instances to reduce build time (#1084)
* disabling some fp8 gemm instances to reduce build time

* disable fp8 gemm instances to reduce build time

* remove the unused variable

* build fp8 gemm default and padded instances separately

* fix include pathsc

[ROCm/composable_kernel commit: c004e0d990]
2023-12-11 17:49:27 -08:00
Bartlomiej Wroblewski
9ef0939a32 Fix IsSupported check in the contraction op (#1066)
Current implementation of IsSupported method in contraction ops does not cover a lot of possible cases in which ScalarPerVector cannot really be used to read A, B or D, or write E.

This PR extends both the regular and multiABD contraction ops with improved checks and also adds new instances with smaller values of ScalarPerVector to support instances that are not supported by other instances.

[ROCm/composable_kernel commit: 89ee47460b]
2023-12-11 17:12:32 +01:00
Illia Silin
8179975502 fix clang format (#1095)
[ROCm/composable_kernel commit: f199035b74]
2023-12-08 14:32:37 -08:00
Nicolas Macchioni
8babb92922 Add F8 dtype definition in f16_f8_f16 gemm instances (#1092)
[ROCm/composable_kernel commit: b4dcd5803f]
2023-12-08 13:30:01 -06:00
Bartłomiej Kocot
2b43fc5c58 Support broadcast for bias in grouped conv fwd (#1081)
* Support broadcast for bias in grouped conv fwd

* Fix comment

* Comment fixes

* Remove GK layout

[ROCm/composable_kernel commit: f836984891]
2023-12-08 11:07:42 +01:00
Illia Silin
71a5ebc233 Switch from ROCmSoftwarePlatform to ROCm org (#1091)
* switch from ROCmSoftwarePlatform to ROCm org

* replace ROCmSoftwarePlatform with ROCm in few more places

[ROCm/composable_kernel commit: d939411dae]
2023-12-07 15:59:34 -08:00
zjing14
464aed7015 remove imcomplete transpose profiler (#1088)
Co-authored-by: Jing Zhang <jizha@amd.com>
Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>

[ROCm/composable_kernel commit: 33600202c6]
2023-12-07 13:39:40 -06:00
dependabot[bot]
800fb9c316 Bump rocm-docs-core from 0.29.0 to 0.30.1 in /docs/sphinx (#1090)
Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[ROCm/composable_kernel commit: 957281ce45]
2023-12-07 10:32:04 -07:00
Illia Silin
a59ac84ce3 Fix the CI builds using clang++ directly. (#1087)
* turn on -O3 compiler flag explicitly

* change cmake syntax for CI

* modify cmake line breaks in jenkinsfile

[ROCm/composable_kernel commit: 6896c3b0ae]
2023-12-06 12:48:10 -08:00
Bartłomiej Kocot
6e7ca15cfc Introduce wrapper library (#1071)
* Introduce wrapper library

* Update cmake files

* Revert "Update cmake files"

This reverts commit c27f88b565.

* Fix comments

[ROCm/composable_kernel commit: 836b7e557d]
2023-12-06 11:58:59 +01:00
Sam Wu
bb2e3e46d5 Standardize documentation for ReadtheDocs (#1057)
Relates to https://github.com/RadeonOpenCompute/rocm-docs-core/issues/330

[ROCm/composable_kernel commit: f60cd9d7a6]
2023-12-05 11:05:55 -07:00
Jun Liu
c9abaf2317 [SWDEV-435347] disable instances failed with mainlien compiler (#1077)
[ROCm/composable_kernel commit: ff24b537cb]
2023-12-04 23:45:16 -08:00
Illia Silin
e1a51c96fc Add daily run with mainline compiler. (#1075)
* add daily build with mainline compiler

* fix the compiler paths for ci

* remove the -flto flag

* build with clang by default

[ROCm/composable_kernel commit: afe4622014]
2023-12-04 19:04:52 -08:00
Bartlomiej Wroblewski
485d099551 Add support for double buffering in direct load GEMM kernel (#1052)
This PR introduces support for double buffering in LDS into GEMM kernels that use direct load instructions.

Direct loads now use inline asm instead of intrinsics. Usage of intrinsics results in compiler adding additional waitcnt instructions what breaks possible load/compute overlap in case of double buffering.

Usage of inline asm results in the need to use sched_barrier in order to make sure that compiler cannot incorrectly reschedule instructions since it does not know the data dependencies between global->LDS and LDS->registers.

[ROCm/composable_kernel commit: bc4bf9bd03]
2023-12-03 23:08:47 +01:00
Jun Liu
ddba364feb [CI] Update Jenkinsfile (#1073)
[ROCm/composable_kernel commit: c7d5c7727b]
2023-11-30 15:24:59 -08:00
zjing14
c7d9a7a84c Fixed GroupedGemmFixedNK with hipGraph (#1065)
* fixed examples; add async_mem_set

* add stream to all deviceOp using SetWorkspace

---------

Co-authored-by: Jing Zhang <jizha@amd.com>

[ROCm/composable_kernel commit: 49df1dc595]
2023-11-30 15:09:27 -06:00
Bartłomiej Kocot
0695c04236 Introduce wrapper for layout (#1054)
* Introduce wrapper for layout

* Extend functionality

* Fix for getLength

* Comment fixes

* Add comments and remove not needed getters

[ROCm/composable_kernel commit: 8ff845f2c4]
2023-11-30 12:11:43 +01:00
arai713
8b5865ba5e Disable transpose device op for MI300 (#1050)
* added working example for 5D input using 1D kernel

* example with 5D input tensor and 2d kernel - not working: issues with arguments

* added updated version of 3d device op - changed descriptors/dims

* added example file to check kernel

* fixed descriptor and isSupportedArgument stride problem

* added and modified kernel for 3d - updated tids/loop

* adding some more 5d example files

* fixed some issues

* changes made for testing

* working version: fixed error in stride for A, still a bit inefficient

* cleaned up formatting/comments

* updating formatting

* more formatting fixes

* fixing cmake, adding back gpu targets in cmake script

* adding client example

* added instances for client example

* fixed errors in client example

* implemented client ex with device_elementwise.hpp and device_elementwise_3d_impl.hpp

* removed extra files

* minor formatting and naming fixes

* adding test files and profiler

* fixing minor error

* minor fix

* removed unneccesary comments, renamed files

* updated instance list for client example, added different layout example

* removing instances

* fixed error in instance generation

* remove comments

* update profiler and client example tensor layouts

* fixed errors in test/profiler

* updated vector dim access to enable vector load

* updated test/profiler files

* updated example with 1d kernel

* updating profiler

* renamed files

* disabled device op for MI300

* skip  elementwise_permute_2d on gfx94x

* Update CMakeLists.txt

* fixing CMake - disabling some GPU targets

---------

Co-authored-by: Jing Zhang <jizha@amd.com>
Co-authored-by: Jing Zhang <jizhan@amd.com>
Co-authored-by: zjing14 <zhangjing14@gmail.com>

[ROCm/composable_kernel commit: a2969aa8b6]
2023-11-29 11:36:40 -06:00
zjing14
b3c60086bf recover default niter (#1064)
[ROCm/composable_kernel commit: ae5e5181aa]
2023-11-28 12:18:42 -08:00
Illia Silin
2e8781c151 Split the static library into several files. (#1044)
* spolit the static library into several

* update lib paths and fix client example

* do not use device_mha_operarions for client examples

* use appropriate libs to link to client examples

* remove the gpu/transpose path from the list

* try fixing clinet examples 3,4,9

* add necessary libs for client examples

* fix the layernorm client example

* fix the client examples 23 and 24

* fix typo

* add interface library and refresh clang format

[ROCm/composable_kernel commit: 7965d66a81]
2023-11-28 11:17:37 -08:00
Rostyslav Geyyer
4e27eae99d Switch default f8 conversion to stochastic rounding (#1048)
* Switch default f8 conversion to stochastic rounding

* Refactor f8-related type_converts

* Add an element-wise op

[ROCm/composable_kernel commit: 6ef034f6ca]
2023-11-27 20:06:17 -06:00
Bartlomiej Wroblewski
6a7d07fcdc Add missing check for K padding in XDL GEMM (#1056)
[ROCm/composable_kernel commit: 60ecfd73f9]
2023-11-27 11:31:39 +01:00
Bartlomiej Wroblewski
d270b881fc Fix cluster length arrange order in fp16 GEMM example (#1055)
[ROCm/composable_kernel commit: bfecc19352]
2023-11-27 11:31:14 +01:00
Bartlomiej Wroblewski
4d9c41c7f5 Add basic support for direct loads from global to LDS (#999)
* Add basic support for direct loads from global to LDS

* Clean the code and comments

* Add support for fp16

* Add comments

* Add check for thread cluster lengths

* Align non-direct-load fp16 example

* Small fixes

* Extend IsSupported to check for supported GPU gens

* Build examples only on the supported HW

* Do not throw when instance not supported in 04 example

* Review: Apply review suggestions

* Review: small fix

* Review: small fix

[ROCm/composable_kernel commit: 627054b941]
2023-11-25 13:35:22 +01:00
zjing14
e25c18aeb7 Improve 4k gemm perf (#1047)
* improve 4k gemm perf

* add f8 instances

* format

---------

Co-authored-by: Jing Zhang <jizha@amd.com>

[ROCm/composable_kernel commit: e8cddfdc3b]
2023-11-17 07:06:24 -06:00
Chao Liu
fcf898f62b [Hotfix] Remove unsed profile_transpose.cpp (#1046)
[ROCm/composable_kernel commit: e1fa00917c]
2023-11-16 14:49:46 -08:00
dependabot[bot]
6fa5727414 Bump rocm-docs-core from 0.26.0 to 0.27.0 in /docs/sphinx (#1023)
Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[ROCm/composable_kernel commit: 61cce232c7]
2023-11-15 22:32:23 -08:00
Bartłomiej Kocot
253ad5bf30 Log CDEBlockTransferScalarPerVector_NPerBlock in conv fwd multiD xdl (#1042)
* Log CDEBlockTransferScalarPerVector_NPerBlock in conv_fwd_multi_d_xdl implementation

* Log CDEBlockTransferScalarPerVector_NPerBlock in conv fwd multiD xdl

[ROCm/composable_kernel commit: 1fefd82ed8]
2023-11-15 17:31:50 +01:00
Bartłomiej Kocot
4bc5d5ddc2 Fix check for conv Fwd Filter1x1Pad0 (#1040)
* Fix check for conv Fwd Filter1x1Pad0

* Fix check for conv Fwd Filter1x1Pad0

[ROCm/composable_kernel commit: 3ef3102fc5]
2023-11-15 17:28:33 +01:00
Bartłomiej Kocot
c80803505f Introduce multiABD api and deprecate multiD (#1035)
* Introduce multiABD api and deprecate multiD

* Replace multiD with multiABD

* Mark structures as deprecated

* Change doxygen deprecated to note to avoid warnings

[ROCm/composable_kernel commit: f2398f612d]
2023-11-14 17:00:40 +01:00
Rostyslav Geyyer
9866e150da Add conv bwd weight client example (#1005)
* Add conv bwd weight client example

* Update instance selector

* Fake the conversion

* Bring the conversion back

[ROCm/composable_kernel commit: 5356c4a943]
2023-11-13 11:16:04 -06:00
arai713
64ab0788f6 Hip tensor permute (#1002)
* adding files for F32 example

* adding functioning implementation with scalar multiplication and unary operator support

* added fp 16 type check in unary square

* updating scalar multiplication as an operator

* functioning version with scalar operator

* changing strides for col major

* updated column major implementation

* working column major implementation

* cleaned up comments, rearranged/renamed files

[ROCm/composable_kernel commit: 454cf7bd1f]
2023-11-13 11:15:48 -06:00
zjing14
1f2e2c83c9 add more instances for bfp16 gemm (#1036)
* add more instances for bfp16

* reduce the gemm input values to prevent round-off errors

---------

Co-authored-by: Jing Zhang <jizha@amd.com>
Co-authored-by: illsilin <Illia.Silin@amd.com>

[ROCm/composable_kernel commit: 600fc000ed]
2023-11-11 07:09:32 -08:00
Bartłomiej Kocot
05d18a052b Support multi AB for grouped conv fwd xdl (#1027)
* Support multi AB for grouped conv fwd xdl

* Add instances

* Add client example

* Add example

* Add interface test

* Minor fixes

Minor fixes

Minor fixes

* Comment fixes

* Fixes

* Reference fix

* Test xdl fixes

* Improve multi_ab interface test

[ROCm/composable_kernel commit: 49e52bb357]
2023-11-10 15:54:44 +01:00
rocking
283920969f Backward of gamma and beta for layernorm and groupnorm (#1013)
* Add layernorm backward reference code

* Add groupnorm backward reference code

* Add example

* clang format

* Fixc bug of reference layernorm and groupnorm

* Fix naming

* Refine naming

* Add device op for normalization bwd gamma and beta

* Refine template parameter

* Add bwd gamma & beta of kernel

* 1. Add groupnorm example
2. Refine layernorm naming

* Narrow down the static check for performance

* Refine variable name

[ROCm/composable_kernel commit: 1db7560365]
2023-11-10 18:02:03 +08:00
Illia Silin
11aeddadae add linker script to QA builds (#1030)
[ROCm/composable_kernel commit: 68f2b5e7c7]
2023-11-08 17:53:45 -08:00
arai713
cba606adf6 Transpose 3d (#984)
* added working example for 5D input using 1D kernel

* example with 5D input tensor and 2d kernel - not working: issues with arguments

* added updated version of 3d device op - changed descriptors/dims

* added example file to check kernel

* fixed descriptor and isSupportedArgument stride problem

* added and modified kernel for 3d - updated tids/loop

* adding some more 5d example files

* fixed some issues

* changes made for testing

* working version: fixed error in stride for A, still a bit inefficient

* cleaned up formatting/comments

* updating formatting

* more formatting fixes

* fixing cmake, adding back gpu targets in cmake script

* adding client example

* added instances for client example

* fixed errors in client example

* implemented client ex with device_elementwise.hpp and device_elementwise_3d_impl.hpp

* removed extra files

* minor formatting and naming fixes

* adding test files and profiler

* fixing minor error

* minor fix

* removed unneccesary comments, renamed files

* updated instance list for client example, added different layout example

* removing instances

* fixed error in instance generation

* remove comments

* update profiler and client example tensor layouts

* fixed errors in test/profiler

* updated vector dim access to enable vector load

* updated test/profiler files

* updated example with 1d kernel

* updating profiler

* renamed files

---------

Co-authored-by: Jing Zhang <jizha@amd.com>

[ROCm/composable_kernel commit: 3af8c81a72]
2023-11-08 19:45:07 -06:00
rocking
867bc90509 Layernorm4d (#1022)
* Rename folder

* Add layernorm 4d fwd example

* Rename original layernorm example

* Add layernorm 4d f16  test

* Add layernorm4d_fwd client example

* Support layernorm4D in ckProfiler

* Rename groupnorm to groupnorm fwd in example

* Rename layernorm and group fwd in test

* Rename normalization to normalization_fwd (instances)

* Add fwd to DeviceNormalization

* Rename external api header

* Rename folder, because we can also add bwd in this folder

* Add fwd in layernorm and groupnorm (profiler

* Fix compile error

---------

Co-authored-by: Po Yen Chen <PoYen.Chen@amd.com>

[ROCm/composable_kernel commit: a3d9a2cd42]
2023-11-09 08:34:51 +08:00