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

fix: Use imported constant for namespace end #1772

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/langgraph/langgraph/pregel/algo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections import defaultdict, deque

Check notice on line 1 in libs/langgraph/langgraph/pregel/algo.py

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 58.0 ms +- 1.3 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 53.1 ms +- 3.1 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 75.3 ms +- 1.0 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 80.0 ms +- 0.6 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 546 ms +- 20 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 491 ms +- 6 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 724 ms +- 18 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 772 ms +- 6 ms ......................................... react_agent_10x: Mean +- std dev: 38.6 ms +- 0.8 ms ......................................... react_agent_10x_sync: Mean +- std dev: 29.4 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 53.9 ms +- 3.1 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 42.6 ms +- 3.7 ms ......................................... react_agent_100x: Mean +- std dev: 424 ms +- 16 ms ......................................... react_agent_100x_sync: Mean +- std dev: 340 ms +- 14 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 913 ms +- 12 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 814 ms +- 14 ms ......................................... wide_state_25x300: Mean +- std dev: 20.0 ms +- 0.3 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 12.5 ms +- 0.1 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 235 ms +- 6 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 228 ms +- 8 ms ......................................... wide_state_15x600: Mean +- std dev: 23.2 ms +- 0.3 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 14.5 ms +- 0.1 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 416 ms +- 13 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 407 ms +- 12 ms ......................................... wide_state_9x1200: Mean +- std dev: 23.2 ms +- 0.3 ms ......................................... WARNING: the benchmark result may be unstable * the standard deviation (1.75 ms) is 12% of the mean (14.9 ms) * the maximum (27.6 ms) is 85% greater than the mean (14.9 ms) Try to rerun the benchmark with more runs, values and/or loops. Run 'python -m pyperf system tune' command to reduce the system jitter. Use pyperf stats, pyperf dump and pyperf hist to analyze results. Use --quiet option to hide these warnings. wide_state_9x1200_sync: Mean +- std dev: 14.9 ms +- 1.7 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 269 ms +- 8 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 258 ms +- 9 ms

Check notice on line 1 in libs/langgraph/langgraph/pregel/algo.py

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+-----------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +=========================================+=========+=======================+ | fanout_to_subgraph_10x_sync | 55.8 ms | 53.1 ms: 1.05x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint | 743 ms | 724 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300 | 20.3 ms | 20.0 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint_sync | 825 ms | 814 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint_sync | 782 ms | 772 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200 | 23.4 ms | 23.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 29.6 ms | 29.4 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x | 38.9 ms | 38.6 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 80.6 ms | 80.0 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600 | 23.4 ms | 23.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_sync | 14.6 ms | 14.5 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300_sync | 12.6 ms | 12.5 ms: 1.00x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_checkpoint_sync | 403 ms | 407 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint_sync | 255 ms | 258 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint | 265 ms | 269 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint | 52.7 ms | 53.9 ms: 1.02x slower | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_sync | 14.6 ms | 14.9 ms: 1.02x slower | +-----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.00x faster | +-----------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (11): fanout_to_subgraph_10x, react_agent_100x_checkpoint, fanout_to_subgraph_10x_checkpoint, fanout_to_subgraph_100x_sync, wide_state_25x300_checkpoint_sync, react_agent_100x_sync, wide_state_25x300_checkpoint, fanout_to_subgraph_100x, wide_state_15x600_checkpoint, react_agent_10x_checkpoint_sync, react_agent_100x
from functools import partial
from hashlib import sha1
from typing import (
Expand Down Expand Up @@ -29,6 +29,7 @@
CONFIG_KEY_TASK_ID,
INTERRUPT,
NO_WRITES,
NS_END,
NS_SEP,
PULL,
PUSH,
Expand Down Expand Up @@ -471,7 +472,7 @@
PULL,
*triggers,
)
task_checkpoint_ns = f"{checkpoint_ns}:{task_id}"
task_checkpoint_ns = f"{checkpoint_ns}{NS_END}{task_id}"
metadata = {
"langgraph_step": step,
"langgraph_node": name,
Expand Down
Loading