Skip to content

Commit 9427f2b

Browse files
Merge pull request #2 from Infini-AI-Lab/core-reorg
Core reorg
2 parents bd8fd57 + ccae8a9 commit 9427f2b

102 files changed

Lines changed: 278 additions & 5380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ your response.
6666
- `server/` — Manager, TCP receiver, FastAPI app.
6767
- `engine/` — Remote inference engine adapters.
6868
- `api/cli_args.py` — RaaS-side dataclass configs.
69-
- `astraflow/workflow/` — Rollout workflows and reward functions
69+
- `astraflow/core/workflow/` — Rollout workflows and reward functions
7070
(swappable).
7171
- `api/` — Base interfaces: `RolloutWorkflow`
7272
(`workflow_api.py`), `AsyncRewardWrapper` (`reward_api.py`).
@@ -82,9 +82,9 @@ your response.
8282
and rewards (`WORKFLOW_REGISTRY`, `REWARD_REGISTRY`).
8383
- `__init__.py` — Imports every `impl/` and `reward/` module so
8484
the registration decorators run at import time.
85-
- `astraflow/weight_manager/` — Weight transport (TCP/ZMQ)
85+
- `astraflow/core/weight_manager/` — Weight transport (TCP/ZMQ)
8686
between trainer and RaaS. `transfer/tests/` holds its unit tests.
87-
- `astraflow/config/` — Hydra/OmegaConf config loader and merging.
87+
- `astraflow/core/config/` — Hydra/OmegaConf config loader and merging.
8888
- `astraEnv/` — Vendored environment code (not part of the package):
8989
`AgentBench` (alfworld, webshop), `ASearcher` (retrieval-augmented
9090
search), `human-eval`. Carries upstream licenses; treat as a
@@ -119,7 +119,7 @@ your response.
119119
vLLM / SGLang inference servers and exposes `/availability`,
120120
`/eval_pull`, weight-update, and rollout endpoints. See
121121
`docs/en/architecture/raas.md` and `custom-raas.md`.
122-
4. **Workflow** (`astraflow/workflow/`) — Rollout workflows
122+
4. **Workflow** (`astraflow/core/workflow/`) — Rollout workflows
123123
(subclasses of `RolloutWorkflow` with `arun_episode`) and reward
124124
callables. New workflows/rewards plug in via decorator
125125
registration in `registry.py`.
@@ -129,7 +129,7 @@ your response.
129129
Conventions for all code under `astraflow/`:
130130

131131
- **Logging**: `astraflow.train_worker.utils.logging.getLogger(__name__)`
132-
(workflow code uses `astraflow.workflow.utils.logging`) — never
132+
(workflow code uses `astraflow.core.workflow.utils.logging`) — never
133133
`print`. Emit metrics through `stats_tracker.get("scope")` and
134134
`StatsLogger`; the latter pushes to W&B / SwanLab.
135135
- **Async**: Rollout workflows are non-blocking. `await` with
@@ -150,7 +150,7 @@ Conventions for all code under `astraflow/`:
150150
consistent. Place heavy optional deps inside function bodies to
151151
avoid import-time side effects (Megatron, flash-attn, etc.).
152152
- **Rewards**: Wrap blocking reward code with `AsyncRewardWrapper`
153-
(`astraflow/workflow/api/reward_api.py`). Standard signature is
153+
(`astraflow/core/workflow/api/reward_api.py`). Standard signature is
154154
`(prompt, completions, prompt_ids, completion_ids, **data)` where
155155
`**data` carries dataset-specific fields (e.g. `answer`); return a
156156
`float`.
@@ -164,9 +164,9 @@ Conventions for all code under `astraflow/`:
164164

165165
### Add a rollout workflow
166166

167-
- Create a new module under `astraflow/workflow/impl/<name>.py`.
167+
- Create a new module under `astraflow/core/workflow/impl/<name>.py`.
168168
- Subclass `RolloutWorkflow`
169-
(`astraflow/workflow/api/workflow_api.py`) and implement async
169+
(`astraflow/core/workflow/api/workflow_api.py`) and implement async
170170
`arun_episode`.
171171
- Thread `GenerationHyperparameters`, tokenizer, reward callable,
172172
stat scope, and optional `dump_dir` through `__init__`. Wrap the
@@ -176,20 +176,20 @@ Conventions for all code under `astraflow/`:
176176
- Persist transcripts to `{dump_dir}/{engine.get_version()}/` when
177177
debugging.
178178
- Decorate the class with `@register_workflow("<name>")` from
179-
`astraflow/workflow/registry.py`, then add an
180-
`import astraflow.workflow.impl.<name>` line to
181-
`astraflow/workflow/__init__.py` so the decorator runs at import
179+
`astraflow/core/workflow/registry.py`, then add an
180+
`import astraflow.core.workflow.impl.<name>` line to
181+
`astraflow/core/workflow/__init__.py` so the decorator runs at import
182182
time. Reference `"<name>"` from `workflow_spec.workflow_cls` in the
183183
recipe YAML.
184184

185185
### Add a reward function
186186

187-
- Create `astraflow/workflow/reward/<name>.py` with a callable
187+
- Create `astraflow/core/workflow/reward/<name>.py` with a callable
188188
matching the reward API contract (see "Rewards" above).
189189
- Decorate it with `@register_reward("<name>")` from
190-
`astraflow/workflow/registry.py`, then add an
191-
`import astraflow.workflow.reward.<name>` line to
192-
`astraflow/workflow/__init__.py`. Reference `"<name>"` from
190+
`astraflow/core/workflow/registry.py`, then add an
191+
`import astraflow.core.workflow.reward.<name>` line to
192+
`astraflow/core/workflow/__init__.py`. Reference `"<name>"` from
193193
`workflow_spec.reward_fn` in the recipe YAML.
194194
- Keep slow or external-service logic in the reward module; let the
195195
calling workflow wrap it with `AsyncRewardWrapper`.

astraEnv/ASearcher/ASearcher/configs/asearcher_local.yaml

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)