-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into afuller/clarify-api
- Loading branch information
Showing
99 changed files
with
7,432 additions
and
4,237 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
.github/workflows/on-pr-opt.yml → ...hub/workflows/build-and-run-all-tests.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build clients on newest UMD | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
timeout: | ||
required: true | ||
description: 'The timeout for the job in minutes' | ||
type: number | ||
default: 30 | ||
pull_request: | ||
branches: ["main"] | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build-tt-metal: | ||
# Due to parsing bug, fromJSON is used to convert string to number. | ||
# In pull_request or push events, the input context is not available, stating the default again here. | ||
timeout-minutes: ${{ fromJSON(inputs.timeout || '30') }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch_name: [grayskull, wormhole_b0, blackhole] | ||
|
||
name: Build tt-metal for ${{ matrix.arch_name }} with newest UMD | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: ghcr.io/tenstorrent/tt-metal/tt-metalium/ubuntu-20.04-amd64:latest | ||
options: --user root | ||
|
||
steps: | ||
- name: Checkout client repo | ||
uses: actions/checkout@v4 | ||
with: | ||
# Clone under tt-metal directory | ||
path: tt-metal | ||
repository: tenstorrent/tt-metal | ||
submodules: recursive | ||
lfs: 'true' | ||
|
||
- name: Checkout UMD | ||
uses: actions/checkout@v4 | ||
with: | ||
# Clone directly into tt-metal directory for umd | ||
path: tt-metal/tt_metal/third_party/umd | ||
submodules: recursive | ||
lfs: 'true' | ||
|
||
- name: Build tt-metal | ||
run: | | ||
cd tt-metal | ||
export ARCH_NAME=${{ matrix.arch_name }} | ||
export TT_METAL_HOME=$(pwd) | ||
export PYTHONPATH=$(pwd) | ||
./build_metal.sh |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#pragma once | ||
|
||
#include <unordered_map> | ||
#include <unordered_set> | ||
|
||
// A standard disjoint set data structure to track connected components. | ||
template <typename T> | ||
class DisjointSet { | ||
public: | ||
void add_item(T item) { parent[item] = item; } | ||
|
||
int get_set(T item) { | ||
while (parent[item] != item) { | ||
item = parent[item]; | ||
} | ||
return item; | ||
} | ||
|
||
void merge(T item1, T item2) { | ||
T set1 = get_set(item1); | ||
T set2 = get_set(item2); | ||
parent[set1] = set2; | ||
} | ||
|
||
bool are_same_set(T item1, T item2) { return get_set(item1) == get_set(item2); } | ||
|
||
int get_num_sets() { | ||
std::unordered_set<T> sets; | ||
for (auto [item, _] : parent) { | ||
sets.insert(get_set(item)); | ||
} | ||
return sets.size(); | ||
} | ||
|
||
private: | ||
std::unordered_map<T, T> parent; | ||
}; |
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,31 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <iostream> | ||
#include <string> | ||
|
||
namespace tt::umd::utils { | ||
|
||
std::string get_abs_path(std::string path) { | ||
// Note that __FILE__ might be resolved at compile time to an absolute or relative address, depending on the | ||
// compiler. | ||
std::filesystem::path current_file_path = std::filesystem::path(__FILE__); | ||
std::filesystem::path umd_root; | ||
if (current_file_path.is_absolute()) { | ||
umd_root = current_file_path.parent_path().parent_path(); | ||
} else { | ||
std::filesystem::path umd_root_relative = | ||
std::filesystem::relative(std::filesystem::path(__FILE__).parent_path().parent_path(), "../"); | ||
umd_root = std::filesystem::canonical(umd_root_relative); | ||
} | ||
std::filesystem::path abs_path = umd_root / path; | ||
return abs_path.string(); | ||
} | ||
|
||
} // namespace tt::umd::utils |
This file was deleted.
Oops, something went wrong.
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.