@tuned-tensor/cli 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -30
- package/dist/{chunk-6RLNBTM6.js → chunk-U5HNS367.js} +371 -40
- package/dist/chunk-U5HNS367.js.map +1 -0
- package/dist/index.js +1243 -842
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +30 -39
- package/dist/local-runtime.js.map +1 -1
- package/docs/local-runtime/aws-gpu.md +144 -26
- package/docs/local-runtime/serving.md +2 -2
- package/docs/local-runtime/spark.md +12 -17
- package/docs/spec-architecture.html +573 -0
- package/docs/spec-workflow.md +131 -0
- package/examples/single-spec/adapter/tunedtensor.json +49 -0
- package/examples/single-spec/foundation/tunedtensor.json +31 -0
- package/package.json +6 -3
- package/training/adapter/src/serve.py +6 -0
- package/dist/chunk-6RLNBTM6.js.map +0 -1
|
@@ -1,27 +1,74 @@
|
|
|
1
1
|
# Use your AWS GPU with the local pipeline
|
|
2
2
|
|
|
3
|
-
TT runs one pipeline on your laptop. Add `gpu` to `
|
|
3
|
+
TT runs one pipeline on your laptop. Add `runtime.gpu` to `tunedtensor.json` to send
|
|
4
4
|
adapter training and CUDA evaluation, or foundation pretraining, fine-tuning,
|
|
5
5
|
RL and evaluation, to an existing EC2 instance in your account. Foundation
|
|
6
6
|
tokenization, dataset preparation, adapter scoring/comparisons, run history,
|
|
7
7
|
and artifact validation stay local. Results return to the usual local
|
|
8
8
|
directories. The laptop does not need an NVIDIA GPU.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
## 1. Install TT and create a project
|
|
11
|
+
|
|
12
|
+
Use CLI 0.16.0 or newer with Node.js 22.19+ on Linux or macOS:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g --ignore-scripts @tuned-tensor/cli
|
|
16
|
+
tt --version
|
|
17
|
+
mkdir my-aws-training && cd my-aws-training
|
|
18
|
+
tt init --name "My AWS Adapter" --model Qwen/Qwen3.5-2B
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Edit the generated `tunedtensor.json`: replace the placeholder system prompt and both placeholder examples with
|
|
22
|
+
your desired instructions and real input/output pairs. For a small functional
|
|
23
|
+
trial, use the [four-example smoke spec](../../examples/local-runtime/smoke-spec.json)
|
|
24
|
+
instead. It checks the workflow, not model quality. An existing project can keep
|
|
25
|
+
its spec and pipeline unchanged.
|
|
26
|
+
|
|
27
|
+
## 2. Prepare your AWS instance
|
|
28
|
+
|
|
29
|
+
You need two separate kinds of access: an **AWS profile** to find the instance,
|
|
30
|
+
and an **SSH key or agent** to execute commands on it. A TT login is unnecessary.
|
|
31
|
+
If you do not already have an instance, launch one in your AWS account or ask
|
|
32
|
+
your administrator to provide one with the prerequisites below.
|
|
33
|
+
|
|
34
|
+
Our CLI 0.16.0 smoke test used a `g5.xlarge` (A10G), an AWS Deep Learning Base
|
|
35
|
+
GPU AMI with Ubuntu 24.04, and a 120 GiB root disk in `eu-west-1`. This is a
|
|
36
|
+
tested small-workload configuration, not a sizing guarantee for other models.
|
|
37
|
+
Use a driver compatible with the bundled CUDA runtime; `tt doctor` checks it.
|
|
38
|
+
|
|
39
|
+
Before launching, check the EC2 GPU quota in your chosen region. For the tested
|
|
40
|
+
G-family On-Demand instance, the quota is **Running On-Demand G and VT instances**
|
|
41
|
+
(`L-DB2E81BA`), measured in vCPUs; one `g5.xlarge` needs 4 available vCPUs.
|
|
42
|
+
If it is too low, follow [AWS's quota increase procedure](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html).
|
|
43
|
+
Approval does not guarantee instance availability. TT does not request capacity
|
|
44
|
+
or choose a different region for you.
|
|
45
|
+
|
|
46
|
+
During launch, select your [EC2 SSH key pair](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html),
|
|
47
|
+
allow inbound TCP 22 from your laptop's IP (or use your private network), and
|
|
48
|
+
record the instance ID, region, SSH username and IP. Follow
|
|
49
|
+
[AWS's SSH connection prerequisites](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-linux-instance.html).
|
|
50
|
+
Instance creation and quota management need separate AWS permissions; TT itself
|
|
51
|
+
only needs `ec2:DescribeInstances` for lookup.
|
|
52
|
+
|
|
53
|
+
## 3. Configure the connection
|
|
54
|
+
|
|
55
|
+
Add this `runtime` section to your existing `tunedtensor.json`, replacing the
|
|
56
|
+
example values with your own. All paths refer to the laptop; TT translates
|
|
57
|
+
paths needed remotely. Existing sidecars can be consolidated with
|
|
58
|
+
`tt pipeline migrate`, which retains `.bak` copies.
|
|
14
59
|
|
|
15
60
|
```json
|
|
16
61
|
{
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
62
|
+
"runtime": {
|
|
63
|
+
"gpu": {
|
|
64
|
+
"provider": "aws",
|
|
65
|
+
"profile": "research",
|
|
66
|
+
"region": "eu-west-1",
|
|
67
|
+
"instanceId": "i-0123456789abcdef0",
|
|
68
|
+
"user": "ubuntu",
|
|
69
|
+
"identityFile": "~/.ssh/research-gpu.pem",
|
|
70
|
+
"maxSeconds": 86400
|
|
71
|
+
}
|
|
25
72
|
}
|
|
26
73
|
}
|
|
27
74
|
```
|
|
@@ -49,7 +96,7 @@ Verify the instance's SSH host key for the selected IP address and connect
|
|
|
49
96
|
once yourself before using TT. TT requires a known host key and noninteractive
|
|
50
97
|
SSH authentication. Omit
|
|
51
98
|
`identityFile` to use your SSH agent or SSH configuration. Relative identity
|
|
52
|
-
file paths resolve beside the
|
|
99
|
+
file paths resolve beside the core spec; `~` expands locally. Set
|
|
53
100
|
`privateIp: true` when connected to the instance's VPC through a VPN or other
|
|
54
101
|
private network. The default uses its public IPv4 address. Security groups and
|
|
55
102
|
network routes must allow the laptop to reach that address over SSH.
|
|
@@ -57,26 +104,62 @@ TT addresses the instance by IP, so any `Host` rules in your SSH configuration
|
|
|
57
104
|
must match that IP. Remote Python commands run through `bash -lc`, which loads
|
|
58
105
|
the login profile so a normal uv installation can be found.
|
|
59
106
|
|
|
107
|
+
After configuring your AWS profile (for SSO, use `aws configure sso` once),
|
|
108
|
+
check access from the same terminal that will run TT:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# SSO profiles only; skip this line for other credential methods.
|
|
112
|
+
aws sso login --profile research
|
|
113
|
+
aws sts get-caller-identity --profile research
|
|
114
|
+
aws ec2 describe-instances --profile research --region eu-west-1 \
|
|
115
|
+
--instance-ids i-0123456789abcdef0 \
|
|
116
|
+
--query 'Reservations[0].Instances[0].[State.Name,PublicIpAddress]' --output text
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Use the returned IP below. First verify its host fingerprint through your AWS
|
|
120
|
+
console or administrator and connect interactively to record the verified key.
|
|
121
|
+
Then confirm that unattended SSH works:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
chmod 400 ~/.ssh/research-gpu.pem
|
|
125
|
+
ssh -o BatchMode=yes -o StrictHostKeyChecking=yes \
|
|
126
|
+
-i ~/.ssh/research-gpu.pem ubuntu@YOUR_INSTANCE_IP \
|
|
127
|
+
'bash -lc "command -v uv rsync setsid timeout; nvidia-smi"'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
If `uv` is missing, install it on that machine using the
|
|
131
|
+
[uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/)
|
|
132
|
+
and make it available in the login shell. Install the other listed prerequisites
|
|
133
|
+
with that machine's package manager. Run the SSH check again before training.
|
|
134
|
+
|
|
135
|
+
## 4. Preview and run
|
|
136
|
+
|
|
137
|
+
Run these commands on your laptop in the project directory. Adapter workflow:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Fetch the base model locally first.
|
|
141
|
+
tt validate tunedtensor.json
|
|
142
|
+
tt models prefetch tunedtensor.json
|
|
143
|
+
tt doctor tunedtensor.json
|
|
144
|
+
tt pipeline run --spec tunedtensor.json --dry-run
|
|
145
|
+
tt pipeline run --spec tunedtensor.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For a foundation spec, no base-model prefetch is needed. Start a new run with:
|
|
149
|
+
|
|
60
150
|
```bash
|
|
61
|
-
# Adapter workflow: fetch the base model locally first.
|
|
62
151
|
tt validate tunedtensor.json
|
|
63
|
-
tt
|
|
64
|
-
tt
|
|
65
|
-
|
|
66
|
-
tt pipeline run --spec tunedtensor.json
|
|
67
|
-
|
|
68
|
-
# Foundation workflow: no base-model prefetch is needed.
|
|
69
|
-
tt doctor tunedtensor.json --config local-runner.json
|
|
70
|
-
tt pipeline run --spec tunedtensor.json --config local-runner.json \
|
|
71
|
-
--resume /absolute/path/to/foundation-run
|
|
152
|
+
tt doctor tunedtensor.json
|
|
153
|
+
tt pipeline run --spec tunedtensor.json \
|
|
154
|
+
--dry-run
|
|
155
|
+
tt pipeline run --spec tunedtensor.json
|
|
72
156
|
```
|
|
73
157
|
|
|
74
158
|
Choose the command block for your spec's engine. `tt doctor` connects to the
|
|
75
159
|
instance and prepares/probes its locked Python/CUDA runtime, which may take
|
|
76
160
|
time on first use. It does not start training or reserve GPU capacity.
|
|
77
161
|
`tt hardware` reports the laptop's hardware; it does not inspect the AWS
|
|
78
|
-
instance. `tt pipeline run`
|
|
79
|
-
spec when `--config` is omitted.
|
|
162
|
+
instance. `tt pipeline run` reads `runtime.gpu` from the selected spec.
|
|
80
163
|
|
|
81
164
|
Keep pipeline step targets set to `local`: the target describes the
|
|
82
165
|
orchestrator, and `gpu` selects where its GPU processes execute. CPU adapter
|
|
@@ -84,6 +167,28 @@ evaluation (`evaluation.inference.device: "cpu"`) stays on the laptop.
|
|
|
84
167
|
Remove `gpu` to execute everything locally. `--dry-run` or `dryRun: true`
|
|
85
168
|
does not connect to AWS or copy files.
|
|
86
169
|
|
|
170
|
+
## 5. Inspect results and finish
|
|
171
|
+
|
|
172
|
+
Wait for a successful completion message. Adapter runs return a run ID and a
|
|
173
|
+
local model ID; use the actual IDs from the output:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
tt runs list
|
|
177
|
+
tt runs report RUN_ID
|
|
178
|
+
tt models list
|
|
179
|
+
tt models verify MODEL_ID
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
For foundation runs, inspect `report.json` in the run directory printed by the
|
|
183
|
+
command. To resume it, pass `--resume /absolute/path/to/foundation-run` to the
|
|
184
|
+
same `tt pipeline run` command. Keep the laptop awake and connected until the
|
|
185
|
+
command finishes and outputs have returned. Review the report before another run.
|
|
186
|
+
|
|
187
|
+
Stop or terminate your instance in AWS when finished, according to your own
|
|
188
|
+
retention needs. TT does not do this for you, even after cancellation or timeout.
|
|
189
|
+
|
|
190
|
+
## Transfers and recovery
|
|
191
|
+
|
|
87
192
|
TT copies only each process's declared data, model snapshot, and runtime files,
|
|
88
193
|
not the workspace or laptop credentials. Adapter runs use an immutable local
|
|
89
194
|
model snapshot; the Hugging Face credential/cache root is never uploaded.
|
|
@@ -129,3 +234,16 @@ The instance remains running after the job; its lifecycle is yours to manage.
|
|
|
129
234
|
Hosted training submission (`tt cloud runs start` and `estimate`) is retired.
|
|
130
235
|
Existing cloud reports and cancellation of older hosted jobs remain available.
|
|
131
236
|
This CLI change does not delete deployed AWS infrastructure or historical data.
|
|
237
|
+
|
|
238
|
+
## Troubleshooting a first run
|
|
239
|
+
|
|
240
|
+
| Symptom | What to check |
|
|
241
|
+
| --- | --- |
|
|
242
|
+
| AWS credentials expired or access denied | Renew your SSO login, check the selected profile/account, and ask for `ec2:DescribeInstances` permission. |
|
|
243
|
+
| Instance not found or not running | Confirm the instance ID and region, and start the instance through AWS. |
|
|
244
|
+
| GPU quota or capacity error during launch | Check the regional quota and AWS capacity; a TT token or credit top-up will not fix it. |
|
|
245
|
+
| SSH timeout or permission denied | Check IP routing, security group TCP 22 access, SSH username, key and agent using the manual SSH command above. |
|
|
246
|
+
| Host key verification failed | Verify the host fingerprint through AWS or your administrator; do not disable strict host checking. |
|
|
247
|
+
| `uv` missing or CUDA probe fails | Check the remote login-shell PATH and GPU driver; rerun `tt doctor` after correcting the host. |
|
|
248
|
+
| Long pause before the GPU process starts | Model inputs are uploaded for every process. Check network speed and free space on both machines, especially remote `/tmp`. |
|
|
249
|
+
| Download fails or staging directory already exists | Preserve the remote directory shown in the error and recover its outputs before retrying. Do not remove the only checkpoint copy. |
|
|
@@ -38,7 +38,7 @@ not mutate the training runtime.
|
|
|
38
38
|
```bash
|
|
39
39
|
tt models prefetch tunedtensor.json
|
|
40
40
|
|
|
41
|
-
tt serve local-<run-id>
|
|
41
|
+
tt serve local-<run-id> \
|
|
42
42
|
--context-length 8192 --max-tokens 512
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -81,7 +81,7 @@ Export a new isolated configuration rather than replacing global settings:
|
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
83
|
export PI_CODING_AGENT_DIR="$(mktemp -d)"
|
|
84
|
-
tt serve local-<run-id>
|
|
84
|
+
tt serve local-<run-id> \
|
|
85
85
|
--context-length 8192 --max-tokens 512 \
|
|
86
86
|
--print-client-config pi > "$PI_CODING_AGENT_DIR/models.json"
|
|
87
87
|
```
|
|
@@ -78,28 +78,23 @@ Edit both generated examples in `tunedtensor.json`. For a meaningful run,
|
|
|
78
78
|
replace them with a larger, representative dataset and a separate validation
|
|
79
79
|
split.
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
durable Spark
|
|
81
|
+
Initialization creates only `tunedtensor.json`; CUDA and project-local storage
|
|
82
|
+
are defaults. For durable Spark paths, add this optional section to the spec:
|
|
83
83
|
|
|
84
84
|
```json
|
|
85
85
|
{
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"modelCache": "/home/eve/.cache/huggingface"
|
|
90
|
-
},
|
|
91
|
-
"evaluation": {
|
|
92
|
-
"inference": {
|
|
93
|
-
"device": "cuda"
|
|
94
|
-
},
|
|
95
|
-
"scoring": {
|
|
96
|
-
"mode": "exact_match"
|
|
97
|
-
},
|
|
98
|
-
"timeoutMs": 1800000
|
|
86
|
+
"runtime": {
|
|
87
|
+
"artifactRoot": "/home/eve/tuned-tensor-runs/artifacts",
|
|
88
|
+
"storeRoot": "/home/eve/tuned-tensor-runs/store",
|
|
89
|
+
"paths": { "modelCache": "/home/eve/.cache/huggingface" }
|
|
99
90
|
}
|
|
100
91
|
}
|
|
101
92
|
```
|
|
102
93
|
|
|
94
|
+
Existing projects can use `tt pipeline migrate` to fold sidecar settings into
|
|
95
|
+
the spec while keeping backups.
|
|
96
|
+
|
|
97
|
+
|
|
103
98
|
Every Python stage uses the locked runtime included in the npm package; a
|
|
104
99
|
source checkout and a custom runner path are neither required nor supported.
|
|
105
100
|
|
|
@@ -110,7 +105,7 @@ tt doctor tunedtensor.json
|
|
|
110
105
|
tt validate tunedtensor.json
|
|
111
106
|
tt models prefetch tunedtensor.json
|
|
112
107
|
tt models verify-base tunedtensor.json
|
|
113
|
-
tt pipeline run --spec tunedtensor.json
|
|
108
|
+
tt pipeline run --spec tunedtensor.json
|
|
114
109
|
```
|
|
115
110
|
|
|
116
111
|
`doctor` resolves the same bundled project and paths the run will use, imports
|
|
@@ -136,7 +131,7 @@ tt serve local-<run-id> --spec tunedtensor.json --port 8000
|
|
|
136
131
|
```
|
|
137
132
|
|
|
138
133
|
`tt serve active` fails unless an adapter is activated. Activation requires a
|
|
139
|
-
`generalRegression` suite in `
|
|
134
|
+
`generalRegression` suite in `tunedtensor.json`. Serve a specific adapter
|
|
140
135
|
with `tt serve local-<run-id>` until then.
|
|
141
136
|
|
|
142
137
|
In another shell:
|