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

Add default ns in put_writes #2404

Merged
merged 1 commit into from
Nov 19, 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
2 changes: 1 addition & 1 deletion libs/checkpoint/langgraph/checkpoint/memory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncio

Check notice on line 1 in libs/checkpoint/langgraph/checkpoint/memory/__init__.py

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 58.0 ms +- 1.9 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 49.3 ms +- 0.6 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 83.6 ms +- 1.6 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 91.1 ms +- 0.9 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 545 ms +- 13 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 479 ms +- 6 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 880 ms +- 42 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 899 ms +- 20 ms ......................................... react_agent_10x: Mean +- std dev: 30.2 ms +- 0.6 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.2 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 46.3 ms +- 0.9 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.3 ms +- 0.4 ms ......................................... react_agent_100x: Mean +- std dev: 337 ms +- 6 ms ......................................... react_agent_100x_sync: Mean +- std dev: 270 ms +- 2 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 933 ms +- 11 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 834 ms +- 10 ms ......................................... wide_state_25x300: Mean +- std dev: 23.6 ms +- 0.5 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 15.2 ms +- 0.3 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 278 ms +- 3 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 266 ms +- 4 ms ......................................... wide_state_15x600: Mean +- std dev: 27.5 ms +- 0.6 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.3 ms +- 0.1 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 478 ms +- 5 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 465 ms +- 7 ms ......................................... wide_state_9x1200: Mean +- std dev: 27.5 ms +- 0.5 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.4 ms +- 0.1 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 312 ms +- 3 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 298 ms +- 4 ms

Check notice on line 1 in libs/checkpoint/langgraph/checkpoint/memory/__init__.py

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +====================================+=========+=======================+ | react_agent_100x_checkpoint | 947 ms | 933 ms: 1.01x faster | +------------------------------------+---------+-----------------------+ | react_agent_100x | 341 ms | 337 ms: 1.01x faster | +------------------------------------+---------+-----------------------+ | wide_state_9x1200 | 27.7 ms | 27.5 ms: 1.01x faster | +------------------------------------+---------+-----------------------+ | react_agent_100x_sync | 272 ms | 270 ms: 1.01x faster | +------------------------------------+---------+-----------------------+ | wide_state_15x600_sync | 17.4 ms | 17.3 ms: 1.01x faster | +------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint | 313 ms | 312 ms: 1.00x faster | +------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_sync | 49.6 ms | 49.3 ms: 1.00x faster | +------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint_sync | 837 ms | 834 ms: 1.00x faster | +------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.2 ms | 22.2 ms: 1.00x slower | +------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint | 83.1 ms | 83.6 ms: 1.01x slower | +------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint_sync | 36.0 ms | 36.3 ms: 1.01x slower | +------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x | 535 ms | 545 ms: 1.02x slower | +------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint | 858 ms | 880 ms: 1.03x slower | +------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.00x slower | +------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (15): wide_state_25x300, wide_state_9x1200_checkpoint_sync, wide_state_15x600, wide_state_15x600_checkpoint, fanout_to_subgraph_10x_checkpoint_sync, wide_state_9x1200_sync, fanout_to_subgraph_100x_checkpoint_sync, wide_state_25x300_checkpoint_sync, fanout_to_subgraph_100x_sync, wide_state_25x300_checkpoint, wide_state_25x300_sync, wide_state_15x600_checkpoint_sync, fanout_to_subgraph_10x, react_agent_10x_checkpoint, react_agent_10x
import random
from collections import defaultdict
from contextlib import AbstractAsyncContextManager, AbstractContextManager
Expand Down Expand Up @@ -361,7 +361,7 @@
RunnableConfig: The updated config containing the saved writes' timestamp.
"""
thread_id = config["configurable"]["thread_id"]
checkpoint_ns = config["configurable"]["checkpoint_ns"]
checkpoint_ns = config["configurable"].get("checkpoint_ns", "")
checkpoint_id = config["configurable"]["checkpoint_id"]
outer_key = (thread_id, checkpoint_ns, checkpoint_id)
outer_writes_ = self.writes.get(outer_key)
Expand Down
Loading