-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
amd fp8 rowwise batched gemm tuning (#3624)
Summary: X-link: facebookresearch/FBGEMM#702 Range-based lookup for fixed B, N, and K Reviewed By: jwfromm Differential Revision: D68780527
- Loading branch information
1 parent
bab9b62
commit 10b8ed7
Showing
25 changed files
with
1,036 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...rowwise_batched_128x16x32x256_16x16_1x1_16x8x1_16x8x1_1x16x1x8_4x4x1_1x1_interwave_v1.hip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "fp8_rowwise_batched_common.h" | ||
|
||
at::Tensor | ||
fp8_rowwise_batched_128x16x32x256_16x16_1x1_16x8x1_16x8x1_1x16x1x8_4x4x1_1x1_interwave_v1( | ||
at::Tensor XQ, | ||
at::Tensor WQ, | ||
at::Tensor x_scale, | ||
at::Tensor w_scale, | ||
at::Tensor Y) { | ||
using DeviceGemmInstance = DeviceGemmHelper< | ||
128, | ||
16, | ||
32, | ||
256, | ||
16, | ||
16, | ||
1, | ||
1, | ||
S<16, 8, 1>, | ||
S<16, 8, 1>, | ||
S<1, 16, 1, 8>, | ||
S<4, 4, 1>, | ||
1, | ||
1, | ||
ck::BlockGemmPipelineScheduler::Interwave, | ||
ck::BlockGemmPipelineVersion::v1, | ||
ck::tensor_operation::device::GemmSpecialization::Default>; | ||
// Run kernel instance. | ||
return f8f8bf16_rowwise_batched_impl<DeviceGemmInstance>(XQ, WQ, x_scale, w_scale, Y); | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
...rowwise_batched_128x16x32x512_16x16_1x1_32x4x1_32x4x1_1x16x1x8_4x4x1_1x1_intrawave_v2.hip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "fp8_rowwise_batched_common.h" | ||
|
||
at::Tensor | ||
fp8_rowwise_batched_128x16x32x512_16x16_1x1_32x4x1_32x4x1_1x16x1x8_4x4x1_1x1_intrawave_v2( | ||
at::Tensor XQ, | ||
at::Tensor WQ, | ||
at::Tensor x_scale, | ||
at::Tensor w_scale, | ||
at::Tensor Y) { | ||
using DeviceGemmInstance = DeviceGemmHelper< | ||
128, | ||
16, | ||
32, | ||
512, | ||
16, | ||
16, | ||
1, | ||
1, | ||
S<32, 4, 1>, | ||
S<32, 4, 1>, | ||
S<1, 16, 1, 8>, | ||
S<4, 4, 1>, | ||
1, | ||
1, | ||
ck::BlockGemmPipelineScheduler::Intrawave, | ||
ck::BlockGemmPipelineVersion::v2, | ||
ck::tensor_operation::device::GemmSpecialization::Default>; | ||
// Run kernel instance. | ||
return f8f8bf16_rowwise_batched_impl<DeviceGemmInstance>(XQ, WQ, x_scale, w_scale, Y); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ise_batched_256x128x128x256_32x32_2x2_16x16x1_16x16x1_1x32x1x8_8x8x1_1x1_intrawave_v3.hip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "fp8_rowwise_batched_common.h" | ||
|
||
at::Tensor | ||
fp8_rowwise_batched_256x128x128x256_32x32_2x2_16x16x1_16x16x1_1x32x1x8_8x8x1_1x1_intrawave_v3( | ||
at::Tensor XQ, | ||
at::Tensor WQ, | ||
at::Tensor x_scale, | ||
at::Tensor w_scale, | ||
at::Tensor Y) { | ||
using DeviceGemmInstance = DeviceGemmHelper< | ||
256, | ||
128, | ||
128, | ||
256, | ||
32, | ||
32, | ||
2, | ||
2, | ||
S<16, 16, 1>, | ||
S<16, 16, 1>, | ||
S<1, 32, 1, 8>, | ||
S<8, 8, 1>, | ||
1, | ||
1, | ||
ck::BlockGemmPipelineScheduler::Intrawave, | ||
ck::BlockGemmPipelineVersion::v3, | ||
ck::tensor_operation::device::GemmSpecialization::Default>; | ||
// Run kernel instance. | ||
return f8f8bf16_rowwise_batched_impl<DeviceGemmInstance>(XQ, WQ, x_scale, w_scale, Y); | ||
} | ||
|
Oops, something went wrong.