Skip to content

Hotfix/benchmarking engine and backends#96

Open
catebros wants to merge 3 commits intohotfix/benchmarking_redesignfrom
hotfix/benchmarking-engine-and-backends
Open

Hotfix/benchmarking engine and backends#96
catebros wants to merge 3 commits intohotfix/benchmarking_redesignfrom
hotfix/benchmarking-engine-and-backends

Conversation

@catebros
Copy link
Copy Markdown

  • Academy support: added AcademyOrchestrationFramework adapter alongside AutoGen/LangGraph
  • Parsl fix: fixed clear() not properly resetting the Parsl backend between runs
  • AutoGen events: renamed event emission in the AutoGen to align with the new event model
  • Dummy model: added calls_per_tool param to DummyAutoGenClient

@catebros catebros requested a review from mturilli March 27, 2026 23:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78d2ed7a-19cb-4185-ab6d-c9a19760d905

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/benchmarking-engine-and-backends

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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 introduces the AcademyOrchestrator to support the Academy agent framework, accompanied by a new example and Makefile target. It also enhances the AutoGenOrchestrator and dummy client with improved event tracking and tool call capabilities, while ensuring the Parsl backend clears its configuration before loading. Feedback includes a recommendation to use asyncio.gather for concurrent execution in the example and a suggestion to refactor duplicated orchestration logic into a common base class to improve maintainability.

Comment on lines +33 to +34
temperature = await self._fetch_temperature(location=location)
humidity = await self._fetch_humidity(location=location)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The _fetch_temperature and _fetch_humidity calls are independent and can be executed concurrently. Using asyncio.gather will run these operations in parallel, which can improve performance by reducing the total execution time from ~4 seconds to ~2 seconds in this example.

Suggested change
temperature = await self._fetch_temperature(location=location)
humidity = await self._fetch_humidity(location=location)
temperature, humidity = await asyncio.gather(
self._fetch_temperature(location=location),
self._fetch_humidity(location=location)
)

Comment on lines +10 to +92
class AcademyOrchestrator(AgentOrchestrator):
def __init__(self, engine: BaseEngine) -> None:
self.engine = engine

def hpc_task(self, func: Callable):
"""
Wraps a function to execute as an HPC task.
"""
task_name = getattr(func, "__name__", str(func))
wrap_id = str(uuid.uuid4())

self.engine.emit(
{
"event": "tool_wrap_start",
"ts": time.perf_counter(),
"tool_name": task_name,
"wrap_id": wrap_id,
}
)

@wraps(func)
async def wrapper(*args, **kwargs):
invocation_id = str(uuid.uuid4())
self.engine.emit(
{
"event": "tool_invoke_start",
"ts": time.perf_counter(),
"tool_name": task_name,
"invocation_id": invocation_id,
}
)
result = await self.engine.execute_tool(
func, *args, invocation_id=invocation_id, **kwargs
)
self.engine.emit(
{
"event": "tool_invoke_end",
"ts": time.perf_counter(),
"tool_name": task_name,
"invocation_id": invocation_id,
}
)
return result

self.engine.emit(
{
"event": "tool_wrap_end",
"ts": time.perf_counter(),
"tool_name": task_name,
"wrap_id": wrap_id,
}
)

return wrapper

def hpc_block(self, block_func: Callable):
"""
Wraps a function to execute as an HPC block.
"""
block_name = getattr(block_func, "__name__", str(block_func))
wrap_id = str(uuid.uuid4())

self.engine.emit(
{
"event": "block_wrap_start",
"ts": time.perf_counter(),
"block_name": block_name,
"wrap_id": wrap_id,
}
)

wrapped_block = self.engine.wrap_node(block_func)

self.engine.emit(
{
"event": "block_wrap_end",
"ts": time.perf_counter(),
"block_name": block_name,
"wrap_id": wrap_id,
}
)

return wrapped_block
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The implementation of AcademyOrchestrator is nearly identical to the updated AutoGenOrchestrator. Both hpc_task and hpc_block methods contain the same logic for event emission and wrapping. To improve maintainability and follow the DRY (Don't Repeat Yourself) principle, this duplicated code should be moved to the AgentOrchestrator base class.

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.

1 participant