-
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.
### Issue First PR towards #248 ### Description First in set of changes to introduce Chip abstraction class according to the plan https://docs.google.com/drawings/d/1-m1azdsBqMA0A6ATYRMfkhyeuOJuGCEI62N5a96LXj0/edit This change also required minor rethinking of some parts of how Cluster is constructed (this took much time to figure out). ### List of the changes - Added Chip class, and derived Local, Remote, and Mock classes. Local will be created for mmio chips, Remote for non-mmio. Mock chip is now only a placeholder, to show the Cluster constructor API changes, but it should merge with existing MockupDevice. Chip is an abstract class. - Chip classes for now only hold soc descriptors and nothing else. Further PRs will gradually move out logic from Cluster to Chip. - get_soc_descriptor and soc_descriptor_per_chip were moved around to conform to the new reality - This was reverted after offline discussion: (Cluster constructor which takes soc descriptor was changed so that it takes tt_SocDescriptor object rather than yaml file. This is because the object also holds harvesting information.) - Added another Cluster constructor which takes a set of chips. This is an experimental one, and users should know what they're doing and they can break the code easily. - Previously mentioned new constructor was used to offer Cluster::create_mock_cluster which is a helper function to build you a cluster with mock chip. - Wrote a test which showcases different constructor usages, which was a leftover from #277 ### Testing Existing tests should prove no functional changes in this PR. ### API Changes This PR has no API changes.
- Loading branch information
Showing
27 changed files
with
484 additions
and
252 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
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,29 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "umd/device/tt_soc_descriptor.h" | ||
#include "umd/device/types/cluster_descriptor_types.h" | ||
|
||
namespace tt::umd { | ||
|
||
// An abstract class that represents a chip. | ||
class Chip { | ||
public: | ||
Chip(tt_SocDescriptor soc_descriptor); | ||
|
||
virtual ~Chip() = default; | ||
|
||
tt_SocDescriptor& get_soc_descriptor(); | ||
|
||
virtual bool is_mmio_capable() const = 0; | ||
|
||
private: | ||
tt_SocDescriptor soc_descriptor_; | ||
}; | ||
|
||
} // namespace tt::umd |
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,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "umd/device/chip/chip.h" | ||
|
||
namespace tt::umd { | ||
class LocalChip : public Chip { | ||
public: | ||
LocalChip(tt_SocDescriptor soc_descriptor); | ||
bool is_mmio_capable() const override; | ||
}; | ||
} // namespace tt::umd |
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,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "umd/device/chip/chip.h" | ||
|
||
namespace tt::umd { | ||
class MockChip : public Chip { | ||
public: | ||
MockChip(tt_SocDescriptor soc_descriptor); | ||
bool is_mmio_capable() const override; | ||
}; | ||
} // namespace tt::umd |
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,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "umd/device/chip/chip.h" | ||
|
||
namespace tt::umd { | ||
class RemoteChip : public Chip { | ||
public: | ||
RemoteChip(tt_SocDescriptor soc_descriptor); | ||
bool is_mmio_capable() const override; | ||
}; | ||
} // namespace tt::umd |
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,15 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "umd/device/chip/chip.h" | ||
|
||
namespace tt::umd { | ||
|
||
Chip::Chip(tt_SocDescriptor soc_descriptor) : soc_descriptor_(soc_descriptor) {} | ||
|
||
tt_SocDescriptor& Chip::get_soc_descriptor() { return soc_descriptor_; } | ||
|
||
} // namespace tt::umd |
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,14 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "umd/device/chip/local_chip.h" | ||
|
||
namespace tt::umd { | ||
|
||
LocalChip::LocalChip(tt_SocDescriptor soc_descriptor) : Chip(soc_descriptor) {} | ||
|
||
bool LocalChip::is_mmio_capable() const { return true; } | ||
} // namespace tt::umd |
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,14 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "umd/device/chip/mock_chip.h" | ||
|
||
namespace tt::umd { | ||
|
||
MockChip::MockChip(tt_SocDescriptor soc_descriptor) : Chip(soc_descriptor) {} | ||
|
||
bool MockChip::is_mmio_capable() const { return true; } | ||
} // namespace tt::umd |
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,14 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "umd/device/chip/remote_chip.h" | ||
|
||
namespace tt::umd { | ||
|
||
RemoteChip::RemoteChip(tt_SocDescriptor soc_descriptor) : Chip(soc_descriptor) {} | ||
|
||
bool RemoteChip::is_mmio_capable() const { return false; } | ||
} // namespace tt::umd |
Oops, something went wrong.