Update: consolidate PTO2 runtime refactor and scheduler fixes#153
Update: consolidate PTO2 runtime refactor and scheduler fixes#153jvjhfhg wants to merge 2 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a substantial refactoring of the PTO2 runtime and scheduler components, primarily focusing on enhancing performance, robustness, and code structure. Key changes include inlining critical data paths, migrating global functions to class member APIs, and unifying task lifecycle management within the scheduler to prevent deadlocks. Additionally, profiling capabilities were reinstated, and analysis tools were improved to provide more accurate and readable performance metrics. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable refactoring of the PTO2 runtime, particularly in the scheduler and memory management components. The changes move C-style free functions to C++ member functions, encapsulating logic for the TensorMap, ring buffers, and scheduler state. This greatly improves code organization, maintainability, and adherence to C++ best practices. Key improvements include unifying task lifecycle handling into a new scheduler API, which resolves potential deadlocks, and restoring profiling hooks for better diagnostics. My review includes a few suggestions for improving clarity and maintainability in the new concurrent logic, but overall, this is an excellent set of changes that modernizes the codebase and makes it more robust.
e7e88f2 to
0966e0c
Compare
0966e0c to
a391550
Compare
a391550 to
05bc82a
Compare
05bc82a to
79ab2f0
Compare
- Inline TensorMap, orchestrator, and ring buffer hot paths while moving runtime data-flow operations to C++ member APIs. - Unify task lifecycle handling in scheduler APIs to remove executor deadlock paths and keep fan-in signaling on relaxed atomics. - Restore PTO2 scheduler profiling hooks after rebase so runtime tracing and diagnostics remain intact. Co-authored-by: poursoul <poursoul@126.com>
- Port AICPU ring-buffer slot state wiring into the current runtime so orchestrator and scheduler share completion/fanin data in device mode. - Reset per-slot scheduler/AICPU state on submit and validate task_id on dispatch/fanout paths to ignore stale entries after slot reuse. - Keep producer/consumer lifecycle balanced when links are added after a producer already completed, preventing premature reclamation. - Relax hot-path atomics from seq_cst to acquire/release and use plain fanin_count reads where the descriptor field is immutable.
79ab2f0 to
b3b9073
Compare
Co-authored-by: poursoul poursoul@126.com