Skip to content

Commit

Permalink
#14590: Move sfpi off LFS (#14758)
Browse files Browse the repository at this point in the history
Remove tt_metal/third_party/sfpi submodule.
Add smarts to tt_metal/hw to download sfpi release into runtome/sfpi

### Ticket
#14590

### Problem description
LFS bad, don't use it.

### What's changed
New reorg and release mechanism for sfpi -- see 
tenstorrent/sfpi#24

Remove tt_metal/third_party/sfpi submodule
Add smarts to tt_metal/hw to lazily fetch a specific sfpi release (this
patch names v0.0.0-lfsectomy, once we're set I'll create v12.0.0 --
numbering them after the GCC major/minor version numbering and use the
micro number for our own updates.

### Checklist
- [YES] Post commit CI passes
- [ ] Blackhole Post commit (if applicable)
- [ ] Model regression CI testing passes (if applicable)
- [ ] Device performance regression CI testing passes (if applicable)
- [ ] New/Existing tests provide coverage for changes

---------

Co-authored-by: Raymond Kim <[email protected]>
  • Loading branch information
nathan-TT and tt-rkim authored Nov 15, 2024
1 parent aea27cd commit 42035c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/ckernels/sfpi"]
path = tt_metal/third_party/sfpi
url = https://github.com/tenstorrent-metal/sfpi-rel-temp.git
[submodule "third_party/pybind11"]
path = tt_metal/third_party/pybind11
url = https://github.com/pybind/pybind11.git
Expand Down
13 changes: 12 additions & 1 deletion tt_metal/hw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ set(TYPES
kernel
)

include(FetchContent)
FetchContent_Declare(
sfpi
URL
https://github.com/tenstorrent/sfpi/releases/download/v5.0.0/sfpi-release.tgz
URL_HASH MD5=10cacabe92846076cb4d7596e46d06be
SOURCE_DIR
${PROJECT_SOURCE_DIR}/runtime/sfpi
)
FetchContent_MakeAvailable(sfpi)

foreach(ARCH IN LISTS ARCHS)
set(DEV_MEM_MAP "${PROJECT_SOURCE_DIR}/tt_metal/hw/inc/${ARCH}/dev_mem_map.h")
set(HW_INCLUDES "${PROJECT_SOURCE_DIR}/tt_metal/hw/inc/${ARCH}")
Expand Down Expand Up @@ -63,7 +74,7 @@ function(get_alias INPUT_STRING OUTPUT_VAR)
endfunction()

# Define the compiler command
set(GPP_CMD ${PROJECT_SOURCE_DIR}/tt_metal/third_party/sfpi/compiler/bin/riscv32-unknown-elf-g++)
set(GPP_CMD ${PROJECT_SOURCE_DIR}/runtime/sfpi/compiler/bin/riscv32-unknown-elf-g++)

set(GPP_DEFINES -DTENSIX_FIRMWARE)

Expand Down
6 changes: 3 additions & 3 deletions tt_metal/jit_build/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void JitBuildEnv::init(uint32_t build_key, tt::ARCH arch, const std::map<std::st
this->out_kernel_root_ = this->out_root_ + to_string(build_key) + "/kernels/";

// Tools
this->gpp_ = this->root_ + "tt_metal/third_party/sfpi/compiler/bin/riscv32-unknown-elf-g++ ";
this->gpp_ = this->root_ + "runtime/sfpi/compiler/bin/riscv32-unknown-elf-g++ ";

// Flags
string common_flags;
Expand Down Expand Up @@ -294,8 +294,8 @@ JitBuildCompute::JitBuildCompute(const JitBuildEnv& env, const JitBuiltStateConf
env_.root_ + "tt_metal/hw/ckernels/" + env.arch_name_ + "/metal/common " + "-I" + env_.root_ +
"tt_metal/hw/ckernels/" + env.arch_name_ + "/metal/llk_io " + "-I" + env_.root_ +
"tt_metal/hw/ckernels/" + env.arch_name_ + "/metal/llk_api " + "-I" + env_.root_ +
"tt_metal/hw/ckernels/" + env.arch_name_ + "/metal/llk_api/llk_sfpu " + "-I" + env_.root_ +
"tt_metal/third_party/sfpi/include " + "-I" + env_.root_ + "tt_metal/hw/firmware/src " + "-I" +
"tt_metal/hw/ckernels/" + env.arch_name_ + "/metal/llk_api/llk_sfpu " + "-I" +
env_.root_ + "runtime/sfpi/include " + "-I" + env_.root_ + "tt_metal/hw/firmware/src " + "-I" +
env_.root_ + "tt_metal/third_party/tt_llk_" + env.arch_name_ + "/llk_lib ";

if (this->is_fw_) {
Expand Down
1 change: 0 additions & 1 deletion tt_metal/third_party/sfpi
Submodule sfpi deleted from 1aab81

0 comments on commit 42035c1

Please sign in to comment.