Skip to content

Tpush#115

Open
azizbek-khabibov wants to merge 10 commits into
hw-native-sys:mainfrom
azizbek-khabibov:tput
Open

Tpush#115
azizbek-khabibov wants to merge 10 commits into
hw-native-sys:mainfrom
azizbek-khabibov:tput

Conversation

@azizbek-khabibov
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the TPush implementation to support additional tile locations and optimizes c2v transfers using linear storage. It also adds new test cases for these scenarios. However, the review identifies several high-severity issues: a major regression in test coverage caused by commenting out nearly all existing tests, and memory leaks in the new test implementations where cleanup logic was disabled. Additionally, the feedback suggests removing dead code and confusing trailing comments in the core headers to improve maintainability.

Comment on lines +40 to +153
# hashfind
# mgather
# mscatter
# setgetval
# tabs
# tadd
# taddc
# tadds
# taddsc
# tassign_alias
# tand
# tands
# targreduceop
# taxpy
# tbroadcast
# tci
# tcmp
# tcmps
# tcolexpand
# tcolexpandop
# tcolmax
# tcolmin
# tcolprod
# tcolreduceidx
# tcolsum
# tconcat
# tcvt
# tdequant
# tdiv
# tdivs
# texp
# texpands
# textract
# tfillpad
# tflashattn
# tfmod
# tfmods
# tgather
# tgatherb
# tget
# tget_async
# tget_scale_addr
# tgetscaleaddr
# thistogram
# timg2col
# tinsert
# tload
# tloadconv
# tlog
# tlrelu
# tmatmul
# tmatmul_layout
# #tmatmul_mx
# tmax
# tmaxs
# tmin
# tmins
# tmov
# tmrgsort
# tmul
# tmuls
# tneg
# tnot
# tnotify
# tor
# tors
# tpartadd
# tpartmul
# tpartmax
# tpartmin
# tprefetch
# tprelu
# tpushpop
# tput
# tput_async
# tquant
# trandom
# trecip
# treduce
# trelu
# trem
# trems
# treshape
# trowexpand
# trowexpandop
# trowmax
# trowmin
# trowreduceidx
# trowsum
# trsqrt
# tscatter
# tsel
# tsels
# tshl
# tshls
# tshr
# tshrs
# tsort32
# tsqrt
# tstore
# tsub
# tsubview
# tsubc
# tsubs
# tsubsc
# ttest
# ttrans
# ttri
# twait
# txor
# txors
# tpushpop_cv_nosplit
# tpushpop_cv
# tpushpop_vc_nosplit
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Commenting out a large number of existing tests is a significant regression in test coverage and should be avoided.

Comment on lines +257 to +260
// pto::cpu_sim::register_hooks(nullptr, nullptr);
// aclrtFree(pipe_mem);
// static_cast<MainPipe::SharedState*>(g_shared_storage_ptr)->~SharedState();
// free(g_shared_storage_ptr);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The cleanup code is commented out, which leads to a memory leak. Please uncomment the cleanup code.

    pto::cpu_sim::register_hooks(nullptr, nullptr);
    aclrtFree(pipe_mem);
    static_cast<MainPipe::SharedState*>(g_shared_storage_ptr)->~SharedState();
    free(g_shared_storage_ptr);

Comment on lines +890 to +893
// pto::cpu_sim::register_hooks(nullptr, nullptr);
// aclrtFree(pipe_mem);
// static_cast<MainPipe::SharedState*>(g_shared_storage_ptr)->~SharedState();
// free(g_shared_storage_ptr);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The cleanup code is commented out, which leads to a memory leak. Please uncomment the cleanup code.

    pto::cpu_sim::register_hooks(nullptr, nullptr);
    aclrtFree(pipe_mem);
    static_cast<MainPipe_3::SharedState*>(g_shared_storage_ptr)->~SharedState();
    free(g_shared_storage_ptr);

Comment thread include/pto/cpu/TPush.hpp
Comment on lines +731 to +734
// using SlotTile = Tile<TileType::Vec, T, consRows, consCols, BLayout::RowMajor, consRows, consCols>;
// SlotTile slotTile;
// TASSIGN(slotTile, static_cast<uint64_t>(pipe.fifo.C2V_CONSUMER_BUF + entryBase));
// cpu_pipe::CopyTileWindow(slotTile, tile, 0, 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The commented-out code is dead code and should be removed to improve maintainability.

Comment thread include/pto/cpu/TPush.hpp
popTileFromGMFiFo<TileCons, Split>(fifo, tile);
return true;
} else if constexpr (TPipe::is_c2v) {
} else if constexpr (TPipe::is_c2v && TileCons::Loc == TileType::Vec) { // && TileCons::Loc != TileType::Vec
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The trailing comment is confusing and should be removed.

            } else if constexpr (TPipe::is_c2v && TileCons::Loc == TileType::Vec) {

Comment thread include/pto/cpu/TPush.hpp
}
return false;
} else if constexpr (TPipe::is_v2c) {
} else if constexpr (TPipe::is_v2c && TileCons::Loc != TileType::Vec) { // && TileCons::Loc == TileType::Vec
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The trailing comment is confusing and should be removed.

            } else if constexpr (TPipe::is_v2c && TileCons::Loc != TileType::Vec) {

@zhoubot
Copy link
Copy Markdown
Collaborator

zhoubot commented May 8, 2026

Triage review (2026-05-08): I do not think this branch is mergeable as-is.

Blockers I found:

  • no checks are reported for the branch;
  • the patch adds whitespace errors (git apply --check --whitespace=warn reports 42 added whitespace issues);
  • the first commit rewrites tests/cpu/st/testcase/CMakeLists.txt so almost the entire CPU ST testcase list is commented out and only tpush_a3 remains active, which would silently drop coverage;
  • the branch overlaps heavily with Fix TPush CPU-SIM A5 support issue #109 and with the recent main TPUSH/TPOP sync (origin/main now contains sync-period/reverse-dependency changes from GitCode).

Please reduce this to a focused patch: keep the CPU-SIM fix and the minimal new regression tests, do not disable unrelated testcases, rebase onto current main, and show git diff --check plus the targeted tpush CPU tests. If #109 is the narrower version of the intended fix, I suggest closing this PR in favor of #109 after carrying over any useful tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants