Skip to content

Commit e0dfe58

Browse files
[rocm-libraries] ROCm/rocm-libraries#6302 (commit 8d419e8)
CK: Remove 41 commented-out dead code blocks (~200 lines) (#6302) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depends on #6300 ## Summary Remove 41 commented-out code blocks across 33 files in Composable Kernel, totaling ~200 lines. Identified using an automated dead code scanning skill (`ck-dead-code`) with a calibrated two-stage pipeline: 1. **Pre-filter**: Keyword-based scan found 1,338 `//`-commented blocks. Calibrated heuristics (trained on 50-sample expert classification) reduced to 89 high-confidence candidates — 93% noise reduction. 2. **Expert triage**: LLM expert classified each block in context as CODE_REMOVE, CODE_KEEP, or NOT_CODE. | Classification | Count | |---------------|-------| | Removed (this PR) | 41 | | Kept (debug helpers, alt configs, reference impls) | 32 | | Not code (false positives) | 16 | Removed blocks include: superseded implementations, old test data, abandoned stubs, unreachable code, and buggy dead code.
1 parent 4d0bbe5 commit e0dfe58

82 files changed

Lines changed: 22 additions & 2883 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codegen/test/grouped_conv_fwd_multiple_d_v1.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ struct Epilogue
198198
input_left_pads,
199199
input_right_pads);
200200

201-
// auto res = rtc::from_gpu(out_dev);
202-
// pass &= ck::utils::check_err(res, out_host, "Error: incorrect results!", 1e-5f, 1e-4f);
203-
// assert(pass);
204-
205201
// Simple check: this checks that the output from each instance matches the output from the
206202
// first instance
207203
CHECK(report(solution, check(rtc::from_gpu(out_dev))));

codegen/test/grouped_conv_fwd_multiple_d_v2.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ struct Epilogue
198198
input_left_pads,
199199
input_right_pads);
200200

201-
// auto res = rtc::from_gpu(out_dev);
202-
// pass &= ck::utils::check_err(res, out_host, "Error: incorrect results!", 1e-5f, 1e-4f);
203-
// assert(pass);
204-
205201
// Simple check: this checks that the output from each instance matches the output from the
206202
// first instance
207203
CHECK(report(solution, check(rtc::from_gpu(out_dev))));

codegen/test/grouped_conv_fwd_multiple_d_v3.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ struct Epilogue
198198
input_left_pads,
199199
input_right_pads);
200200

201-
// auto res = rtc::from_gpu(out_dev);
202-
// pass &= ck::utils::check_err(res, out_host, "Error: incorrect results!", 1e-5f, 1e-4f);
203-
// assert(pass);
204-
205201
// Simple check: this checks that the output from each instance matches the output from the
206202
// first instance
207203
CHECK(report(solution, check(rtc::from_gpu(out_dev))));

codegen/test/grouped_conv_fwd_multiple_d_v4.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ struct Epilogue
198198
input_left_pads,
199199
input_right_pads);
200200

201-
// auto res = rtc::from_gpu(out_dev);
202-
// pass &= ck::utils::check_err(res, out_host, "Error: incorrect results!", 1e-5f, 1e-4f);
203-
// assert(pass);
204-
205201
// Simple check: this checks that the output from each instance matches the output from the
206202
// first instance
207203
CHECK(report(solution, check(rtc::from_gpu(out_dev))));

example/60_gemm_multi_ABD/gemm_multi_ABD_xdl_multiply_bias_fastgelu_bf16_i8.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,6 @@ int main(int argc, char* argv[])
238238

239239
Tensor<B1DataType> b_k_n(f_host_tensor_descriptor(K, N, StrideB, B0Layout{}));
240240

241-
#if 0
242-
for(int n = 0; n < N; ++n)
243-
{
244-
for(int k = 0; k < K; ++k)
245-
{
246-
b_element_op(b_k_n(k, n), b0_k_n(k, n), b1_k_n(k, n));
247-
}
248-
}
249-
#endif
250-
251241
using ReferenceGemmInstance = ck::tensor_operation::host::ReferenceGemm<A0DataType,
252242
B0DataType,
253243
CShuffleDataType,

example/65_gemm_multiply_multiply/moe_gemm2_xdl_fp8.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ int main(int argc, char* argv[])
252252
Tensor<ck::index_t> expert_ids(HostTensorDescriptor({sorted_tile_num}, {1}));
253253
Tensor<ck::index_t> sorted_token_ids(HostTensorDescriptor({sorted_size}, {1}));
254254
Tensor<ck::index_t> max_token_id(HostTensorDescriptor({1}));
255-
// max_token_id.mData[0] = valid_size;
256-
// max_token_id.mData = {valid_size, 0, 2, 3, 4, 6, 8, 10, 12, 13};
257-
// int eids[] = {0, 0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 3, 3, 3};
258255
max_token_id.mData = {valid_size, 0, 1, 2, 3, 4, 5, 6, 7, 8};
259256
// int eids[] = {0, 1, 2, 3, 4, 5, 6, 7, 3, 3, 3}; // {2, 1, 1, 2, 2, 2, 1, 2}
260257
for(int i = 0; i < sorted_tile_num; i++)

example/65_gemm_multiply_multiply/moe_gemm2_xdl_fp8_blockscale.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@ int main(int argc, char* argv[])
261261
Tensor<ck::index_t> max_token_id(HostTensorDescriptor({1}));
262262

263263
max_token_id.mData = {valid_size, 0, 1, 2, 3, 4, 5, 6, 7, 8};
264-
// int eids[] = {0, 1, 3, 3, 3};
265-
// int eids[] = {0, 1, 2, 3, 4, 5, 6, 7}; //, 3, 3, 3}; // {2, 1, 1, 2, 2, 2, 1, 2}
266-
// int eids[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 3, 3, 3};
267-
// int eids[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
268-
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
269-
// 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270-
// 3, 3, 3, 3, 3, 3, 3, 3, 4, 4,
271-
// 5, 5, 5, 5, 6, 6, 6, 6, 7, 7,
272-
// 7, 7,
273-
// 3, 3, 3};
274264
for(int i = 0; i < sorted_tile_num; i++)
275265
{
276266
expert_ids.mData[i] = i / ck::math::integer_divide_ceil(valid_tile_num, experts);

example/ck_tile/11_add_rmsnorm2d_rdquant/instances/add_rmsnorm2d_rdquant_fwd_bf16_n1024_instance.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
// clang-format off
77
// rm rn tm tn vn pd x 3p
8-
#if 0
9-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, 1, 2, 4, 64, 8, true , true, false>>(const S&, A);
10-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, 1, 4, 4, 64, 4, true , true, false>>(const S&, A);
11-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, 1, 8, 4, 64, 2, true , true, false>>(const S&, A);
12-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, 1, 16, 4, 64, 1, true , true, false>>(const S&, A);
13-
14-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, 1, 1, 1, 256, 4, true , true, false>>(const S&, A);
15-
#endif
168

179
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, ck_tile::int8_t, 1, 1, 2, 128, 8, true, true, false>>(const S&, A);
1810
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::bf16_t, ck_tile::int8_t, 1, 2, 2, 128, 4, true, true, false>>(const S&, A);

example/ck_tile/11_add_rmsnorm2d_rdquant/instances/add_rmsnorm2d_rdquant_fwd_fp16_n1024_instance.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
// clang-format off
77
// rm rn tm tn vn pd x 3p
8-
#if 0
9-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, 1, 2, 4, 64, 8, true , true, false>>(const S&, A);
10-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, 1, 4, 4, 64, 4, true , true, false>>(const S&, A);
11-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, 1, 8, 4, 64, 2, true , true, false>>(const S&, A);
12-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, 1, 16, 4, 64, 1, true , true, false>>(const S&, A);
13-
14-
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, 1, 1, 1, 256, 4, true , true, false>>(const S&, A);
15-
#endif
168

179
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, ck_tile::int8_t, 1, 1, 2, 128, 8, true, true, false>>(const S&, A);
1810
template float add_rmsnorm2d_rdquant_fwd_<trait_<ck_tile::fp16_t, ck_tile::int8_t, 1, 2, 2, 128, 4, true, true, false>>(const S&, A);

example/ck_tile/12_smoothquant/instances/smoothquant_bf16_n1024_instance.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
// clang-format off
77
// rm rn tm tn vn pd 2p
8-
#if 0
9-
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 2, 4, 64, 8, true, false>>(const S&, A);
10-
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 4, 4, 64, 4, true, false>>(const S&, A);
11-
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 8, 4, 64, 2, true, false>>(const S&, A);
12-
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 16, 4, 64, 1, true, false>>(const S&, A);
13-
14-
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 1, 1, 256, 4, true, false>>(const S&, A);
15-
#endif
168

179
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 1, 2, 128, 8, true, false>>(const S&, A);
1810
template float smoothquant_<trait_<ck_tile::bf16_t, 1, 2, 2, 128, 4, true, false>>(const S&, A);

0 commit comments

Comments
 (0)