Conversation
There was a problem hiding this comment.
Thanks for putting this together! Having an architecture guide for AI agents is a great idea. The overall structure and descriptions look solid.
I did a cross-check against the codebase and noticed a few things that might be worth double-checking:
Potential inaccuracies
-
graphkitvsnetworkfox(Execution Graph section) —ami/graphkit_wrapper.pyappears to import fromnetworkfox, notgraphkit. The file is namedgraphkit_wrapper.pybut the actual library seems to benetworkfox. Is this intentional/historical? -
Manager inheritance — The doc describes Manager similarly to other components that extend
Node, butManagerseems to only extendCollector(notNode). Worth clarifying? -
ZMQ socket types — The doc says PUB/SUB, but the code appears to use
XPUB/SUBfor manager→workers and manager→clients. There also seems to be aROUTER/DEALERpattern for view data that isn't mentioned. -
ami-mpidescription — The doc saysami-mpi -n 4 psana://...for multiple workers with psana, butami-mpilooks like a bash wrapper script (not a Python entry point) with a 1-node limit. Isami-remotethe actual underlying entry point here? -
"ami-local does not support multiple workers with psana" — I couldn't find this restriction in the code (
-nseems to accept any value with any source). Is this a practical limitation rather than a code-enforced one? -
AutoExport— Listed as a class in the Communication section, but it looks like anAutoNameinstance (AutoExport = AutoName("_export_")). Minor, but could confuse an AI agent.
Minor suggestions
- The GUI is PyQtGraph-based (via
pyqtgraphandqtpy), not raw PyQt — might be worth noting - The
ami-workerexample might need a-H manager_hostflag to be complete - The file tree is a useful subset but missing some notable files (
local.py,remote.py,sync.py,forkedpdb.py,console.py,monitor.py)
Overall this is a really useful doc — just flagging these in case any of them are actual errors vs. things I'm misreading. You'd know better than me!
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
|
|
||
| ### Starting AMI | ||
|
|
||
| 1. **Workers**: `ami-worker -n 3 psana://exp=rix101331225,run=156` |
There was a problem hiding this comment.
In distributed mode, ami-worker also requires -H manager_host to connect to the manager. Might be worth including for completeness.
There was a problem hiding this comment.
we normally just run everything on the same host, but if we go to multi-node then it would be needed.
There was a problem hiding this comment.
Could we add a note somewhere to reflect "we normally just run everything on the same host"?
| 4. **Local mode**: | ||
| - Random source: `ami-local -n 3 random://examples/worker.json` | ||
| - Psana offline run (single worker): `ami-local -f interval=1 -b 1 psana://exp=rix101331225,run=156` | ||
| - Psana with multiple workers: `ami-mpi -n 4 psana://exp=rix101345725,run=67` (ami-local does not support multiple workers with psana) |
There was a problem hiding this comment.
Two things here: (1) ami-mpi appears to be a bash wrapper script (not a Python entry point) that currently only supports 1 node. The underlying Python entry point seems to be ami-remote. (2) The claim "ami-local does not support multiple workers with psana" — I couldn't find this restriction in the code (-n accepts any value with any source). Is this a practical limitation rather than a code-enforced one?
There was a problem hiding this comment.
-
you would not run ami-remote directly, thats kind of the equivalent of running ami-worker or ami-node. ami-mpi is the equivalent of running ami-local. ive forgotten the reason we can't run more than 1 node with ami-mpi, it was something to do with starting the local collectors i think?
-
this is a limitation of psana. ami-local
-nuses multiprocessing, so ami offline with psana effectively makes every worker see every single event, you are not partitioning events among the workers since psana needs mpi for that. maybe we should have a check if you runami-local -n (more than 1 worker) psana://to just print a message to use ami-mpi.
There was a problem hiding this comment.
I see. Could we add notes somewhere to highlight these two points?
Try to make opencode work better for ami by adding an agents.md.