mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
better logging for devex
This commit is contained in:
parent
3a85ede8ba
commit
9bd299b3ef
4 changed files with 29 additions and 2 deletions
18
README.md
18
README.md
|
|
@ -331,6 +331,17 @@ env = MyTeacherEnv(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can either:
|
||||||
|
|
||||||
|
- build a teacher-enabled env by mixing `TeacherDistillationEnv` into an existing
|
||||||
|
`BaseEnv`-derived env such as `GSM8kEnv`, or
|
||||||
|
- subclass `TeacherDistillationEnv` directly and implement the usual environment
|
||||||
|
methods yourself.
|
||||||
|
|
||||||
|
In both cases, `TeacherDistillationEnv` still assumes the normal `BaseEnv`
|
||||||
|
runtime contract: tokenized rollouts, `ScoredDataGroup` payloads, and the
|
||||||
|
standard `handle_send_to_api(...)` transport path.
|
||||||
|
|
||||||
CLI shape:
|
CLI shape:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -345,6 +356,13 @@ If `--teacher.model_name` is a deployment alias rather than a tokenizer
|
||||||
identifier, also set `--teacher.tokenizer_name ...` so the env can validate
|
identifier, also set `--teacher.tokenizer_name ...` so the env can validate
|
||||||
tokenizer compatibility.
|
tokenizer compatibility.
|
||||||
|
|
||||||
|
Scope note:
|
||||||
|
|
||||||
|
- The teacher-aware CLI wiring currently exists for `serve`.
|
||||||
|
- If `teacher_enabled=True`, the generic `process` and `evaluate` commands will
|
||||||
|
fail loudly at env construction time unless you instantiate the env yourself
|
||||||
|
and pass `teacher_server_configs=...`.
|
||||||
|
|
||||||
Tokenizer requirement:
|
Tokenizer requirement:
|
||||||
|
|
||||||
- Teacher distillation currently requires the teacher and student to use the same tokenizer vocabulary.
|
- Teacher distillation currently requires the teacher and student to use the same tokenizer vocabulary.
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,11 @@ class TeacherDistillationEnv(BaseEnv, ABC):
|
||||||
if config.teacher_enabled:
|
if config.teacher_enabled:
|
||||||
if teacher_server_configs is None:
|
if teacher_server_configs is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"teacher_enabled=True requires teacher_server_configs at init."
|
"teacher_enabled=True but no teacher server configuration was "
|
||||||
|
"provided. Pass teacher_server_configs=... when instantiating "
|
||||||
|
"the environment directly, or use the teacher-aware 'serve' CLI "
|
||||||
|
"path with --teacher.* flags. The generic BaseEnv 'process' and "
|
||||||
|
"'evaluate' commands do not currently wire teacher_server_configs."
|
||||||
)
|
)
|
||||||
teacher_config_source = teacher_server_configs
|
teacher_config_source = teacher_server_configs
|
||||||
self.teacher_server = ServerManager(
|
self.teacher_server = ServerManager(
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ def test_init_requires_teacher_server_source(monkeypatch):
|
||||||
teacher_enabled=True,
|
teacher_enabled=True,
|
||||||
teacher_top_k=0,
|
teacher_top_k=0,
|
||||||
)
|
)
|
||||||
with pytest.raises(ValueError, match="teacher_enabled=True requires"):
|
with pytest.raises(ValueError, match="no teacher server configuration was provided"):
|
||||||
_ConcreteTeacherEnv(
|
_ConcreteTeacherEnv(
|
||||||
config=config,
|
config=config,
|
||||||
server_configs=[],
|
server_configs=[],
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,11 @@ If `$TEACHER_MODEL` is a deployment alias instead of a tokenizer identifier,
|
||||||
also set `--teacher.tokenizer_name ...` so the env can validate
|
also set `--teacher.tokenizer_name ...` so the env can validate
|
||||||
tokenizer compatibility.
|
tokenizer compatibility.
|
||||||
|
|
||||||
|
The teacher-aware CLI path is currently wired for `serve`. If
|
||||||
|
`teacher_enabled=True`, the generic `process` and `evaluate` commands are not
|
||||||
|
teacher-aware and will fail loudly unless the environment is instantiated
|
||||||
|
manually with `teacher_server_configs=...`.
|
||||||
|
|
||||||
Why cross-tokenizer conversion is not acceptable here:
|
Why cross-tokenizer conversion is not acceptable here:
|
||||||
|
|
||||||
- Teacher token ID `1234` and student token ID `1234` can correspond to different text.
|
- Teacher token ID `1234` and student token ID `1234` can correspond to different text.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue