-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#0: Refactor/commonize some embeddings code and add support for outpu…
…t sharded embeddings
- Loading branch information
Showing
9 changed files
with
497 additions
and
351 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
27 changes: 27 additions & 0 deletions
27
ttnn/cpp/ttnn/operations/data_movement/tilize/device/kernels/compute/tilize.cpp
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,27 @@ | ||
// SPDX-FileCopyrightText: © 2024 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include <cstdint> | ||
|
||
#include "compute_kernel_api/tilize.h" | ||
|
||
namespace NAMESPACE { | ||
void MAIN { | ||
constexpr uint32_t cb_id_in0 = get_compile_time_arg_val(0); | ||
constexpr uint32_t cb_id_out0 = get_compile_time_arg_val(1); | ||
constexpr uint32_t per_core_block_cnt = get_compile_time_arg_val(2); | ||
constexpr uint32_t per_core_block_tile_cnt = get_compile_time_arg_val(3); | ||
tilize_init(cb_id_in0, per_core_block_tile_cnt, cb_id_out0); | ||
|
||
for (uint32_t b = 0; b < per_core_block_cnt; ++b) { | ||
cb_wait_front(cb_id_in0, per_core_block_tile_cnt); | ||
cb_reserve_back(cb_id_out0, per_core_block_tile_cnt); | ||
|
||
tilize_block(cb_id_in0, per_core_block_tile_cnt, cb_id_out0); | ||
|
||
cb_push_back(cb_id_out0, per_core_block_tile_cnt); | ||
cb_pop_front(cb_id_in0, per_core_block_tile_cnt); | ||
} | ||
} | ||
} // namespace NAMESPACE |
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
Oops, something went wrong.