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

Runtime/Compiler - Support ComputeConfig::unpack_to_dest_mode #879 #955

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

kmabeeTT
Copy link
Contributor

@kmabeeTT kmabeeTT commented Oct 21, 2024

Note: This is blocked on tt-metal uplift. Will rebase + change target to main when tt-metal uplift is merged. For ease of viewing I picked base as my own branch for now on this PR.

Closes #879

Relatively simple change to accommodate API change in tt-metal introduced at tenstorrent/tt-metal#12794

  • Pass field (per CB) down from compiler to runtime to metal API
  • Hardcoded to UnpackToDestMode::Default (preserve previous/default behavior) and for all 32 CBs for now because tt-metal requires this (will be relaxed soon), replace with compiler logic when ready.

==

About workaround:

  1. Talked to Radomir who added constraint in tt-metal (field must be set for all 32 CBs) originally about relaxing it ( [Bug Report] Remove restriction that UnpackToDestFormat must be specified for NUM_CIRCULAR_BUFFERS=32 CBs tt-metal#14066 )
  2. Not sure what proper change in TTIRToTTMetal.cpp (to set field for only in-use CBs) will look like, it's a compiler task to figure out once above metal fix is pulled in.

@kmabeeTT
Copy link
Contributor Author

Cleaned up changes. Had discussion with @nsmithtt offline this morning, decided to:

  1. Don't need to hardcode using 32, instead we already have a tablegen-generated code to get max value of enum, use that instead
  2. Add assert that our value of 32 (from say 1+ ttkernel::getMaxEnumValForCBPort()) is equal to tt-metal's NUM_CIRCULAR_BUFFERS=32)
  3. To do that, have tt-metal export that value (required in a tt-metal ticket already) and put it in our system-desc, and consume it in TTIRToTTMetal.cpp

Made changes for number-1 above already on PR, going to try to see what changes look like for 2,3 (with system-desc hardcoding num_circlular_buffers=32 until metal exports it).

include/ttmlir/Target/Common/types.fbs Outdated Show resolved Hide resolved
@kmabeeTT kmabeeTT force-pushed the kmabee/issue_879_unpack_to_dest_mode branch from 4ec088e to 671f6ad Compare October 23, 2024 13:39
 - Most recent tt-metal uplift removed preserve_fp32_precision and
   replaced with unpack_to_dest_mode vector on ComputeConfig

 - Export NUM_CIRCULAR_BUFFERS from tt-metal into system-desc's ChipDesc
   and use it for assert in tt-mlir compiler to ensure compiler/metal
   view of max number of CB's is aligned.

 - Pass new enum UnpackToDestMode (per CB) down from compiler to
   runtime to metal API
@kmabeeTT kmabeeTT force-pushed the kmabee/issue_879_unpack_to_dest_mode branch from 671f6ad to 0151238 Compare October 28, 2024 16:14
@kmabeeTT kmabeeTT requested a review from vmilosevic as a code owner October 28, 2024 16:14
@kmabeeTT kmabeeTT changed the base branch from kmabee/metal_uplift to main October 28, 2024 16:14
 - Looks like this test is intending to run with custom soc_desc, annoying.
@kmabeeTT kmabeeTT merged commit d7c655c into main Oct 28, 2024
13 checks passed
@kmabeeTT kmabeeTT deleted the kmabee/issue_879_unpack_to_dest_mode branch December 8, 2024 15:14
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.

Support ComputeConfig::unpack_to_dest_mode
5 participants