Skip to content

Migrate to RHAPSODY#68

Merged
AymenFJA merged 15 commits intomainfrom
feature/rhapsody-2
Feb 24, 2026
Merged

Migrate to RHAPSODY#68
AymenFJA merged 15 commits intomainfrom
feature/rhapsody-2

Conversation

@AymenFJA
Copy link
Collaborator

This PR removes the execution backends from AsyncFlow and relies on RHAPSODY for AI-HPC execution.

AsyncFlow will no longer have execution capabilities; instead, it will be a higher entity that controls RHAPSODY and orchestrates a large scale of async workflows with complex dependencies while offloading the task execution to RHAPSODY.

From a migration perspective, the application-level frameworks such as ROSE, IMPRESS, DDSim, and FACTs will require at least 1 line of code change.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AymenFJA, 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 represents a significant architectural shift for AsyncFlow, transitioning it from a system with internal execution capabilities to a dedicated workflow orchestration layer. By removing its own execution backends and integrating with RHAPSODY, AsyncFlow can now leverage RHAPSODY's specialized AI-HPC execution features, allowing AsyncFlow to focus on managing complex dependencies and workflow logic more effectively.

Highlights

  • Execution Backend Removal: Removed all internal execution backends, including Concurrent, Dask, and Radical Pilot, from AsyncFlow.
  • RHAPSODY Integration: Migrated AsyncFlow to rely entirely on the external RHAPSODY framework for AI-HPC task execution.
  • Architectural Refocus: Refactored AsyncFlow to function as a high-level orchestrator for complex asynchronous workflows, delegating execution concerns.
  • Noop Backend Simplification: Simplified and decoupled the NoopExecutionBackend, moving it to a standalone module and removing its dependency on the old base backend and state management.

🧠 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
  • src/radical/asyncflow/init.py
    • Removed imports and exports for ConcurrentExecutionBackend, DaskExecutionBackend, and RadicalExecutionBackend.
    • Updated the import path for NoopExecutionBackend.
  • src/radical/asyncflow/backends/execution/base.py
    • Removed the BaseExecutionBackend abstract class and the Session class.
  • src/radical/asyncflow/backends/execution/concurrent.py
    • Removed the ConcurrentExecutionBackend implementation.
  • src/radical/asyncflow/backends/execution/dask_parallel.py
    • Removed the DaskExecutionBackend implementation.
  • src/radical/asyncflow/backends/execution/radical_pilot.py
    • Removed the RadicalExecutionBackend implementation.
  • src/radical/asyncflow/constants.py
    • Removed the TasksMainStates enum and the StateMapper class.
  • src/radical/asyncflow/noop_executor.py
    • Renamed the file from src/radical/asyncflow/backends/execution/noop.py.
    • Refactored NoopExecutionBackend to be a standalone class, no longer inheriting from BaseExecutionBackend.
    • Introduced NoopSession and NoopStateMapper classes within the file.
    • Removed the registration of backend states with the global StateMapper.
  • src/radical/asyncflow/workflow_manager.py
    • Removed the import of BaseExecutionBackend.
    • Updated the import path for NoopExecutionBackend.
    • Modified the type hint for the 'backend' parameter in WorkflowEngine's constructor to be generic.
  • tests/integration/test_workflow_failures.py
    • Removed the import of ThreadPoolExecutor.
    • Updated the import of ConcurrentExecutionBackend to use 'rhapsody.backends.execution'.
    • Removed the ThreadPoolExecutor argument during ConcurrentExecutionBackend instantiation.
  • tests/integration/test_workflow_runs_to_completion.py
    • Removed the import of ThreadPoolExecutor.
    • Updated the import of ConcurrentExecutionBackend to use 'rhapsody.backends.execution'.
    • Removed the ThreadPoolExecutor argument during ConcurrentExecutionBackend instantiation.
  • tests/unit/test_data_dependencies.py
    • Removed the import of ThreadPoolExecutor.
    • Updated the import of ConcurrentExecutionBackend to use 'rhapsody.backends.execution'.
    • Removed the ThreadPoolExecutor argument during ConcurrentExecutionBackend instantiation.
  • tests/unit/test_dependencies_resloution.py
    • Removed the import of ThreadPoolExecutor.
    • Updated the import of ConcurrentExecutionBackend to use 'rhapsody.backends.execution'.
    • Removed the ThreadPoolExecutor argument during ConcurrentExecutionBackend instantiation.
  • tests/unit/test_failure_propagation.py
    • Removed the import of ThreadPoolExecutor.
    • Updated the import of ConcurrentExecutionBackend to use 'rhapsody.backends.execution'.
    • Removed the ThreadPoolExecutor argument during ConcurrentExecutionBackend instantiation.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request undertakes a significant migration to offload execution capabilities to RHAPSODY, which is reflected by the removal of the internal execution backend implementations. The changes in the test files correctly adapt to this by using the ConcurrentExecutionBackend from rhapsody.

However, the refactoring appears to be incomplete in src/radical/asyncflow/workflow_manager.py. While the import for BaseExecutionBackend has been removed, it is still referenced as a type hint in the create and _setup_execution_backend methods. This will cause a NameError at runtime and is a critical issue that needs to be addressed. These methods need to be updated to remove the dependency on the now-deleted BaseExecutionBackend.

Additionally, I've left a specific comment regarding a removed type hint in WorkflowEngine.__init__ that should be restored for code clarity.

def __init__(
self,
backend: BaseExecutionBackend,
backend,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The type hint for the backend parameter has been removed. While the old BaseExecutionBackend is no longer applicable, it's good practice to maintain type hints for clarity and static analysis. Please add a type hint for the backend. If there isn't a specific base class from RHAPSODY to use, typing.Any would be a suitable replacement for now.

Suggested change
backend,
backend: Any,

into rhapsody. Asyncflow now ships only NoopExecutionBackend and
LocalExecutionBackend in a single backends.py module. External backends
(e.g. from rhapsody) plug in via simple import. Also fixes missing
cloudpickle import, stale type annotations, and updates all tests to
use asyncflow's LocalExecutionBackend.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

1-Add prompt_task
2-Add support for concurrent backends
3-Add explicit task routing via @task(backend='..')
@AymenFJA AymenFJA merged commit 2da8d9b into main Feb 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant