Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttnn ops backend metal wrapper lib #1230

Merged
merged 4 commits into from
Nov 28, 2024

Conversation

mbezuljTT
Copy link
Contributor

@mbezuljTT mbezuljTT commented Nov 12, 2024

TTNNOpModelLib is to be used for op model interface (constraints, l1, perf)

TTNNOpModelLib is static library that allows us to call ttnn and tt-metal API from mlir TTNN Dialect to enable direct calls to compiler ops API to query for arguments validity, L1 usage, and performance.

image

The specifics are LLVM/MLIR have exceptions disabled and are built with C++ 17.
Metal is built with exceptions and with C++ 20.

As we are building MLIR and metal using same compiler version, we shouldnt get any ABI issues.
Exceptions would be handled within TTNNWrapperLib.

Added TTMLIR_ENABLE_OPMODEL to be used for this specific build, build has been added to CI. No tests are added, as we add MNIST ops, we shall add MNIST optimizer test. We shall agree when to make this mode enabled by default.

@nsmithtt @nobradovictt @sdjordjevicTT I think this should be good initial version

@vmilosevic please take a look at CI changes,

@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch 2 times, most recently from 467b4b7 to c5b33f2 Compare November 12, 2024 13:38
Copy link
Contributor

@nsmithtt nsmithtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mbezuljTT, these changes look great! Some comments inline

lib/Backend/TTNN/TTNNWrapperLib.cpp Outdated Show resolved Hide resolved
lib/Backend/TTNN/TTNNWrapperLib.cpp Outdated Show resolved Hide resolved
lib/Backend/TTNN/TTNNWrapperLib.cpp Outdated Show resolved Hide resolved
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch 2 times, most recently from eeb084a to 6577759 Compare November 14, 2024 16:15
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch 3 times, most recently from bbc53b4 to 0634367 Compare November 25, 2024 09:49
@mbezuljTT mbezuljTT self-assigned this Nov 25, 2024
@mbezuljTT mbezuljTT marked this pull request as ready for review November 25, 2024 09:53
include/ttmlir/OpModel/TTNN/TTNNOpModel.hpp Outdated Show resolved Hide resolved
lib/OpModel/TTNN/TTNNOpModelLib.cpp Outdated Show resolved Hide resolved
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch from fddfb02 to 8bc11da Compare November 26, 2024 05:25
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

include/ttmlir/OpModel/TTNN/TTNNOpModel.h Show resolved Hide resolved
include/ttmlir/OpModel/TTNN/TTNNOpModel.h Outdated Show resolved Hide resolved
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch from 8bc11da to 6cba062 Compare November 26, 2024 11:19
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

include/ttmlir/OpModel/TTNN/TTNNOpModel.h Outdated Show resolved Hide resolved
include/ttmlir/OpModel/TTNN/TTNNOpModel.h Outdated Show resolved Hide resolved
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch 2 times, most recently from 217998a to d1d1019 Compare November 26, 2024 14:01
@mbezuljTT mbezuljTT requested a review from jnie-TT November 27, 2024 07:41
@mbezuljTT mbezuljTT force-pushed the mbezulj/2410-ttnnopsbackend-metal-wrapper-lib branch from e17d8c8 to 4028b7b Compare November 27, 2024 21:03
@mbezuljTT
Copy link
Contributor Author

Addressed all comments, merging this PR. afterthoughts are OK, please reach out;

@mbezuljTT mbezuljTT merged commit ae987d5 into main Nov 28, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants