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] initial support for running model on device #8

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

pilkicTT
Copy link
Contributor

  • moves device specific code from tt_torch_device/ into runtime/
  • adds TTSystem class (singleton) for holding all info on present devices
  • runs mlir compiler as a separate compile stage, which at the end generates flatbuffer binary
  • implements CompiledModel class for running inference on compiled model
  • run_binary() is the function which invokes tt-mlir runtime

NOTE: with this commit, the following tests are passing:

  • pybuda/test/test_api.py
  • pybuda/test/mlir/test_ops.py::test_add
  • pybuda/test/mlir/test_ops.py::test_multiply

@nsmithtt
Copy link
Contributor

moves device specific code from tt_torch_device/ into runtime/

It seems like tt_torch_device directory still exists, is this intended to stay or will it eventually be removed? Seems a bit confusing to have both, but if this is only intermediate step then seems OK!

@nsmithtt
Copy link
Contributor

It seems like tt_torch_device directory still exists, is this intended to stay or will it eventually be removed? Seems a bit confusing to have both, but if this is only intermediate step then seems OK!

Nvm, it makes sense after taking a look. I think the only thing that's a bit confusing is that there are 2 sets of tt_device.hpp and tt_device.cpp. Maybe we can rename the tt_torch_device/tt_device*? It mostly holds the python bindings so maybe we could call it bindings? Or torch_runtime or something? Just throwing out ideas.

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.

Looks great!!

@pilkicTT pilkicTT force-pushed the pilkic/device-runtime branch from 8fb96a7 to 47bb5ff Compare July 24, 2024 13:25
- moves device specific code from `tt_torch_device/` into `runtime/`
- adds `TTSystem` class (singleton) for holding all info
on present devices
- runs mlir compiler as a separate compile stage, which at the end
generates flatbuffer binary
- implements `CompiledModel` class for running inference on compiled
model
- `run_binary()` is the function which invokes tt-mlir runtime

NOTE: with this commit, the following tests are passing:
- pybuda/test/test_api.py
- pybuda/test/mlir/test_ops.py::test_add
- pybuda/test/mlir/test_ops.py::test_multiply
@pilkicTT pilkicTT force-pushed the pilkic/device-runtime branch from 5ac06d4 to 35b0f5c Compare July 24, 2024 14:12
@pilkicTT
Copy link
Contributor Author

It seems like tt_torch_device directory still exists, is this intended to stay or will it eventually be removed? Seems a bit confusing to have both, but if this is only intermediate step then seems OK!

Nvm, it makes sense after taking a look. I think the only thing that's a bit confusing is that there are 2 sets of tt_device.hpp and tt_device.cpp. Maybe we can rename the tt_torch_device/tt_device*? It mostly holds the python bindings so maybe we could call it bindings? Or torch_runtime or something? Just throwing out ideas.

Yeah, I was thinking of moving it to under runtime, e.g. runtime/torch - will be done in changes to follow (there is still a lot of refactoring to do 😄).

@pilkicTT pilkicTT merged commit e05b7e2 into main Jul 24, 2024
1 check failed
@pilkicTT pilkicTT deleted the pilkic/device-runtime branch August 5, 2024 09:07
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.

5 participants