-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduce debug singleton object used to hold debug environment information during runtime. This could be a good place to store new kinds of debug flags in the future for runtime. - Wire it up through ttrt. - loadKernelsFromDisk added to denote reloading of generated kernels from /tmp, from previous run, instead of loading them from the flatbuffer. - Name the kernels with program and location info from the MLIR graph. Now names look like /tmp/ttmlir_multiply_%5_tensix.cpp ^ ^ ^ Func name -/ | | | | Result Value Loc -/ | | Thread type/info [noc, eth, tensix] -/
- Loading branch information
Showing
11 changed files
with
183 additions
and
9 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,41 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef TT_RUNTIME_DETAIL_DEBUG_H | ||
#define TT_RUNTIME_DETAIL_DEBUG_H | ||
|
||
#include <ostream> | ||
|
||
namespace tt::runtime::debug { | ||
|
||
struct Env { | ||
#if defined(TT_RUNTIME_DEBUG) && TT_RUNTIME_DEBUG == 1 | ||
static Env const & | ||
#else | ||
constexpr static Env | ||
#endif | ||
get(bool loadKernelsFromDisk = false) | ||
#if defined(TT_RUNTIME_DEBUG) && TT_RUNTIME_DEBUG == 1 | ||
; | ||
#else | ||
{ | ||
return Env(false); | ||
} | ||
#endif | ||
|
||
bool loadKernelsFromDisk; | ||
|
||
private: | ||
constexpr Env(bool loadKernelsFromDisk) | ||
: loadKernelsFromDisk(loadKernelsFromDisk) {} | ||
}; | ||
|
||
inline std::ostream &operator<<(std::ostream &os, Env const &env) { | ||
os << "Env{loadKernelsFromDisk=" << env.loadKernelsFromDisk << "}"; | ||
return os; | ||
} | ||
|
||
} // namespace tt::runtime::debug | ||
|
||
#endif // TT_RUNTIME_DETAIL_DEBUG_H |
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,18 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "tt/runtime/detail/debug.h" | ||
|
||
#if defined(TT_RUNTIME_DEBUG) && TT_RUNTIME_DEBUG == 1 | ||
|
||
namespace tt::runtime::debug { | ||
|
||
Env const &Env::get(bool loadKernelsFromDisk) { | ||
static Env config(loadKernelsFromDisk); | ||
return config; | ||
} | ||
|
||
} // namespace tt::runtime::debug | ||
|
||
#endif |
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
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