Skip to content

Commit 09b45ac

Browse files
author
anon
committed
fix(parallelism): mix sequence_id into parallel sub-app keys
1 parent a7e4489 commit 09b45ac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

burr/core/parallelism.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def _create_task(key: str, action: Action, substate: State) -> SubGraphTask:
518518
def _tasks() -> Generator[SubGraphTask, None, None]:
519519
for i, action in enumerate(self.actions(state, context, inputs)):
520520
for j, substate in enumerate(self.states(state, context, inputs)):
521-
key = f"{i}-{j}" # this is a stable hash for now but will not handle caching
521+
key = f"{context.sequence_id}-{i}-{j}"
522522
yield _create_task(key, action, substate)
523523

524524
async def _atasks() -> AsyncGenerator[SubGraphTask, None]:
@@ -528,7 +528,7 @@ async def _atasks() -> AsyncGenerator[SubGraphTask, None]:
528528
states = await async_utils.arealize(state_generator)
529529
for i, action in enumerate(actions):
530530
for j, substate in enumerate(states):
531-
key = f"{i}-{j}"
531+
key = f"{context.sequence_id}-{i}-{j}"
532532
yield _create_task(key, action, substate)
533533

534534
return _atasks() if self.is_async() else _tasks()

0 commit comments

Comments
 (0)