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

Additional fixes to metal runtime bootstrap #290 #291

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

nsmithtt
Copy link
Contributor

@nsmithtt nsmithtt commented Aug 4, 2024

  • Make inputs per-device (multi-device inputs still need to be worked out)
  • Create common functions for creating metal Buffers and CoreRange from flatbuffer types
  • Implement wait API + events, update ttrt to use it
  • Bug fix logical_grid_size -> compute_with_storage_grid_size, the latter accurately gives post-harvested shape
  • Automatically move inputs / outputs during submit

- Make inputs per-device (multi-device inputs still need to be worked
out)
- Create common functions for creating metal Buffers and CoreRange from
flatbuffer types
- Implement wait API + events, update ttrt to use it
- Bug fix logical_grid_size -> compute_with_storage_grid_size, the
latter accurately gives post-harvested shape
- Automatically move inputs / outputs during submit
@nsmithtt nsmithtt force-pushed the nsmith/metal-runtime3 branch from 81b81b9 to f2fddea Compare August 7, 2024 00:54
@nsmithtt nsmithtt requested a review from jnie-TT August 7, 2024 01:38
Copy link
Contributor

@kmabeeTT kmabeeTT left a comment

Choose a reason for hiding this comment

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

LGTM! One request in general (here and elsewhere) is it would help if we could have comments per function.

runtime/lib/binary.cpp Outdated Show resolved Hide resolved
buffer->set_address(command->ref()->address());
buffers[command->ref()->global_id()] = buffer;
buffers[command->ref()->global_id()] =
createBufferFromTensorRef(device, command->ref());
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome.

executeCommandQueue(device, cq, cq_id, inputs, outputs));
++cq_id;
}

Events copyEvents =
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to double check, idea here is that if device outputs need to be copied to host, we will ignore earlier events generated from the execution of programs, by just returning the newer events that represent the copying (reads) of outputs from device to host... seems to make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, though we don't ignore the earlier events, they are waited on inside of maybeCopyHostOutputs.

@tapspatel
Copy link
Contributor

ttrt code lgtm!

@nsmithtt nsmithtt force-pushed the nsmith/metal-runtime3 branch from b91c0a0 to 13f40c5 Compare August 7, 2024 18:57
@nsmithtt nsmithtt merged commit 2e687dc into main Aug 7, 2024
6 checks passed
@nsmithtt nsmithtt deleted the nsmith/metal-runtime3 branch August 7, 2024 19:46
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