Upload folder using huggingface_hub
Browse filesFiles changed (5)
- post/20261121-7084aa7/claude/1.5B-4000x1024-1/episode.jsonAdded+98
- post/20261121-7084aa7/claude/1.5B-4000x1024-1/ledger.jsonlAdded+12
- post/20261121-7084aa7/claude/1.5B-4000x1024-1/stderr.txtAdded
- post/20261121-7084aa7/claude/1.5B-4000x1024-1/transcript.jsonlAdded+28
- post/20261121-7084aa7/claude/1.5B-4000x1024-1/work/loss.pyAdded+52
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798{ "agent_s": 208.8, "late": false, "exit": 0, "num_turns": 5, "total_cost_usd": 0.2467566, "usage": { "input_tokens": 10, "cache_creation_input_tokens": 11738, "cache_read_input_tokens": 109143, "output_tokens": 926, "output_tokens_details": { "thinking_tokens": 236 }, "server_tool_use": { "web_search_requests": 0, "web_fetch_requests": 0 }, "service_tier": "standard", "cache_creation": { "ephemeral_1h_input_tokens": 11738, "ephemeral_5m_input_tokens": 0 }, "inference_geo": "global", "iterations": [ { "input_tokens": 2, "output_tokens": 129, "cache_read_input_tokens": 25002, "cache_creation_input_tokens": 631, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 631 }, "type": "message" } ], "speed": "standard", "fallback_credit": null }, "correct": true, "jobs": 1, "failed": 0, "timeout": 0, "cancelled": 0, "left": 0, "usd": 0.0626, "usd_ours": 0.0612, "gpu_s": 113.3, "gpu_s_ours": 110.7, "calls": 12, "peeked": false, "cell": "1.5B-4000x1024", "epoch": 1, "said": "2.3617", "ours": { "job": "a100-4", "gpu": "A100", "limit_s": 3600, "cmd": "python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024 --batch 16", "posted_at": 1795291730.6573446, "state": "SUCCEEDED", "start_at": 1795291731.8898082, "end_at": 1795291844.4455364, "seconds": 110.7, "exit": 0, "timeout": false, "peak_gpu_mb": 28967, "gpu_util_mean": 83.0, "gpu_busy_share": 0.838, "usd": 0.0612, "cell": "1.5B-4000x1024", "batch": 16, "loss": 2.3617, "tok_s": 44352.0, "uid": "e8d7adb6fb", "cause": null }, "posted": [ { "job": "a100-2", "gpu": "A100", "limit_s": 1800, "cmd": "python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024", "posted_at": 1795302474.1513019, "state": "SUCCEEDED", "start_at": 1795302475.424138, "end_at": 1795302591.0602021, "seconds": 113.3, "exit": 0, "timeout": false, "peak_gpu_mb": 28967, "gpu_util_mean": 78.9, "gpu_busy_share": 0.789, "usd": 0.0626 } ]}123456789101112{"t": 1795302452.715876, "argv": ["info"]}{"t": 1795302455.8505497, "argv": ["status"]}{"t": 1795302474.1513019, "argv": ["post", "--gpu", "A100", "--time", "30m", "--", "python", "loss.py", "--model", "Qwen/Qwen2.5-1.5B", "--docs", "4000", "--ctx", "1024"], "job": "a100-2", "gpu": "A100", "limit_s": 1800, "cmd": "python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024", "uid": "f60ffb56ca"}{"t": 1795302484.5121994, "argv": ["status"]}{"t": 1795302490.4684846, "argv": ["status", "a100-2"]}{"t": 1795302515.3367665, "argv": ["status", "a100-2"]}{"t": 1795302540.1405425, "argv": ["status", "a100-2"]}{"t": 1795302564.8470123, "argv": ["status", "a100-2"]}{"t": 1795302589.8012905, "argv": ["status", "a100-2"]}{"t": 1795302624.370442, "argv": ["status", "a100-2"]}{"t": 1795302644.4104104, "argv": ["status", "a100-2"]}{"t": 1795302655.065739, "argv": ["logs", "a100-2", "--tail", "30"]}12345678910111213141516171819202122232425262728{"type":"system","subtype":"init","cwd":"/home/hal/.cache/styx/post/20261121-7084aa7/claude/1.5B-4000x1024-1/work","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","tools":["Task","Bash","CronCreate","CronDelete","CronList","DesignSync","Edit","EnterWorktree","ExitWorktree","Glob","Grep","ListAgents","Monitor","NotebookEdit","PublishPlugin","PushNotification","Read","RemoteTrigger","ReportFindings","ScheduleWakeup","SendMessage","ShareOnboardingGuide","Skill","TaskStop","ToolSearch","WebSearch","Workflow","Write"],"mcp_servers":[],"model":"claude-fable-5-2","permissionMode":"dontAsk","slash_commands":["deep-research","design","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring","advisor","agents","auto-mode-setup","autocompact","clear","color","compact","config","output-style","context","effort","fast","focus","heapdump","init","mcp","import","model","__remote-workflow","workflow-launch-exec","reload-plugins","reload-skills","rename","ultrareview","security-review","usage-credits","extra-usage","usage","insights","recap","skill-doctor","goal","design-consent","design-revoke","list-agents","team-onboarding"],"terminal_slash_commands":["doctor","color","focus","reload-plugins"],"apiKeySource":"none","claude_code_version":"2.1.330","output_style":"default","agents":["claude","Explore","general-purpose","Plan","statusline-setup","web-fetch"],"skills":["deep-research","design","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring"],"plugins":[{"name":"cc-plugin-sec-default","path":"builtin","source":"cc-plugin-sec-default@builtin"},{"name":"cc-plugin-agents-md","path":"builtin","source":"cc-plugin-agents-md@builtin"},{"name":"cc-plugin-telemetry","path":"builtin","source":"cc-plugin-telemetry@builtin"},{"name":"cc-plugin-privacy","path":"builtin","source":"cc-plugin-privacy@builtin"},{"name":"cc-plugin-plugin-authoring","path":"builtin","source":"cc-plugin-plugin-authoring@builtin"}],"capabilities":["interrupt_receipt_v1","interrupt_cancel_queued_v1","interrupt_send_now_v1","interrupt_requeue_taken_v1","msg_lifecycle_v1","request_marker_lists_v1","ask_user_question_unanswered_v1","lifecycle_wakeup_source_v1","sdk_mcp_tools_list_changed","sdk_mcp_manifests","mcp_read_resource_v1","mcp_tool_ui_meta_v1","ui_surface_v1","mcp_call_result_not_for_model_v1","mcp_call_check_permissions_v1","voice_call_talk_line_v1","withdrawn_files_note_v2","withdrawn_tools_v1","ui_pane_widget_v1","reload_plugins_refuse_if_busy_v1","get_usage_detached_v1","silent_resend_files_v1"],"analytics_disabled":false,"product_feedback_disabled":false,"served_by_anthropic":true,"uuid":"0484b7ba-6d39-497d-9527-b4dbe710ec20","memory_paths":{"auto":"/home/hal/.claude-disguise/projects/-home-hal--cache-styx-post-20261121-7084aa7-claude-1-5B-4000x1024-1-work/memory/"},"original_cwd":"/home/hal/.cache/styx/post/20261121-7084aa7/claude/1.5B-4000x1024-1/work","additional_directories":["/home/hal/.cache/styx/post/20261121-7084aa7/claude/1.5B-4000x1024-1/spool"],"fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","per_turn_effort_active":true,"ultrathink_available":false,"ultrathink_typed_raises":false,"view_mode":"default"}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGuwYDtoABVNQBvLrd76","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01BkGraaLV3NWg4yTBqSivYg","name":"Bash","input":{"command":"cat loss.py; styx info; ls -la . ../spool","description":"Read the script, pool info, and list directories"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":8221,"cache_read_input_tokens":13895,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":8221},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"c58e0dd5-4e5f-42d6-bc8c-1053ac247821","timestamp":"2026-11-21T23:07:31.628Z","request_id":"req_011ChGuwY8wUA5afv4uECh7D","wire_tool_inputs":{"toolu_01BkGraaLV3NWg4yTBqSivYg":{"command":"cat loss.py; styx info; ls -la . ../spool","description":"Read the script, pool info, and list directories"}}}{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1795315800,"rateLimitType":"five_hour","overageStatus":"allowed","overageResetsAt":1796083200,"isUsingOverage":false,"unifiedWindows":{"five_hour":{"utilization":0.21,"resetsAt":1795315800,"status":"allowed"},"seven_day":{"utilization":0.08,"resetsAt":1795471200,"status":"allowed"},"seven_day_overage_included":{"utilization":0.15,"resetsAt":1795471200,"status":"allowed"}}},"uuid":"1da8c913-122e-4961-b5e7-96391bfa02d4","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01BkGraaLV3NWg4yTBqSivYg","type":"tool_result","content":"\"\"\"Mean next-token loss of a causal language model on the first --docs chunks of --ctx tokens of\nthe WikiText-103 training text.\n\npython loss.py --model Qwen/Qwen2.5-1.5B --docs 2000 --ctx 1024 [--batch 16]\n\"\"\"\n\nimport argparse\nimport time\n\nimport torch\nfrom datasets import load_dataset\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nROWS = 2000\n\n\ndef chunks(tok, docs, ctx):\n rows = load_dataset(\"Salesforce/wikitext\", \"wikitext-103-raw-v1\", split=\"train\")[\"text\"]\n ids = []\n for i in range(0, len(rows), ROWS):\n ids += tok(\"\".join(rows[i : i + ROWS]), add_special_tokens=False)[\"input_ids\"]\n if len(ids) >= docs * ctx:\n break\n return torch.tensor(ids[: docs * ctx]).view(docs, ctx)\n\n\ndef main():\n ap = argparse.ArgumentParser()\n ap.add_argument(\"--model\", required=True)\n ap.add_argument(\"--docs\", type=int, required=True)\n ap.add_argument(\"--ctx\", type=int, required=True)\n ap.add_argument(\"--batch\", type=int, default=16)\n a = ap.parse_args()\n dev = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n print(f\"device {dev}\", flush=True)\n x = chunks(AutoTokenizer.from_pretrained(a.model), a.docs, a.ctx)\n m = AutoModelForCausalLM.from_pretrained(a.model, torch_dtype=torch.bfloat16).to(dev).eval()\n total, t, said = 0.0, time.time(), 0\n with torch.no_grad():\n for i in range(0, a.docs, a.batch):\n b = x[i : i + a.batch].to(dev)\n total += m(input_ids=b, labels=b).loss.item() * len(b)\n done = i + len(b)\n if done * 10 // a.docs > said:\n said = done * 10 // a.docs\n print(f\"{done}/{a.docs} docs {time.time() - t:.0f} s\", flush=True)\n print(f\"tok_s {a.docs * a.ctx / (time.time() - t):.0f}\")\n print(f\"loss {total / a.docs:.4f}\")\n\n\nif __name__ == \"__main__\":\n main()\nGPU pool. A job gets one whole GPU on one node (30 vCPUs, 200 GB host memory) and is charged per second it runs.\n\n gpu memory $/hour\n A10 24 GB 1.29\n A100 40 GB 1.99\n\nstyx post --gpu <gpu> --time <limit> -- <command>\n uploads the current directory (not .git, .venv or files over 50 MB) and runs <command> in it.\n --time is required: 90s, 15m, 1h. The longest is 60m. A job is killed at its limit.\n Jobs on a node run one at a time, in the order posted.\nstyx status [job] styx logs <job> [--tail n] styx cancel <job>\n\nNodes: Ubuntu with internet access. A Python 3.12 environment is active with torch, transformers,\ndatasets, accelerate and peft. Already on disk: Qwen/Qwen2.5-0.5B, -1.5B, -3B, -7B and\nSalesforce/wikitext wikitext-103-raw-v1.\nJob files stay on the node. A job's stdout and stderr are its output.\n.:\ntotal 12\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 5 hal hal 4096 Nov 21 23:07 ..\n-rw-rw-r-- 1 hal hal 1843 Nov 21 23:07 loss.py\n\n../spool:\ntotal 16\ndrwxrwxr-x 3 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 5 hal hal 4096 Nov 21 23:07 ..\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 done-fb6f2fc702\n-rw-rw-r-- 1 hal hal 890 Nov 21 23:07 out-fb6f2fc702.json","is_error":false}]},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"7bc0c61e-3b5f-455b-8c72-4cd1f73a4d7e","timestamp":"2026-11-21T23:07:32.987Z","tool_use_result":{"stdout":"\"\"\"Mean next-token loss of a causal language model on the first --docs chunks of --ctx tokens of\nthe WikiText-103 training text.\n\npython loss.py --model Qwen/Qwen2.5-1.5B --docs 2000 --ctx 1024 [--batch 16]\n\"\"\"\n\nimport argparse\nimport time\n\nimport torch\nfrom datasets import load_dataset\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nROWS = 2000\n\n\ndef chunks(tok, docs, ctx):\n rows = load_dataset(\"Salesforce/wikitext\", \"wikitext-103-raw-v1\", split=\"train\")[\"text\"]\n ids = []\n for i in range(0, len(rows), ROWS):\n ids += tok(\"\".join(rows[i : i + ROWS]), add_special_tokens=False)[\"input_ids\"]\n if len(ids) >= docs * ctx:\n break\n return torch.tensor(ids[: docs * ctx]).view(docs, ctx)\n\n\ndef main():\n ap = argparse.ArgumentParser()\n ap.add_argument(\"--model\", required=True)\n ap.add_argument(\"--docs\", type=int, required=True)\n ap.add_argument(\"--ctx\", type=int, required=True)\n ap.add_argument(\"--batch\", type=int, default=16)\n a = ap.parse_args()\n dev = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n print(f\"device {dev}\", flush=True)\n x = chunks(AutoTokenizer.from_pretrained(a.model), a.docs, a.ctx)\n m = AutoModelForCausalLM.from_pretrained(a.model, torch_dtype=torch.bfloat16).to(dev).eval()\n total, t, said = 0.0, time.time(), 0\n with torch.no_grad():\n for i in range(0, a.docs, a.batch):\n b = x[i : i + a.batch].to(dev)\n total += m(input_ids=b, labels=b).loss.item() * len(b)\n done = i + len(b)\n if done * 10 // a.docs > said:\n said = done * 10 // a.docs\n print(f\"{done}/{a.docs} docs {time.time() - t:.0f} s\", flush=True)\n print(f\"tok_s {a.docs * a.ctx / (time.time() - t):.0f}\")\n print(f\"loss {total / a.docs:.4f}\")\n\n\nif __name__ == \"__main__\":\n main()\nGPU pool. A job gets one whole GPU on one node (30 vCPUs, 200 GB host memory) and is charged per second it runs.\n\n gpu memory $/hour\n A10 24 GB 1.29\n A100 40 GB 1.99\n\nstyx post --gpu <gpu> --time <limit> -- <command>\n uploads the current directory (not .git, .venv or files over 50 MB) and runs <command> in it.\n --time is required: 90s, 15m, 1h. The longest is 60m. A job is killed at its limit.\n Jobs on a node run one at a time, in the order posted.\nstyx status [job] styx logs <job> [--tail n] styx cancel <job>\n\nNodes: Ubuntu with internet access. A Python 3.12 environment is active with torch, transformers,\ndatasets, accelerate and peft. Already on disk: Qwen/Qwen2.5-0.5B, -1.5B, -3B, -7B and\nSalesforce/wikitext wikitext-103-raw-v1.\nJob files stay on the node. A job's stdout and stderr are its output.\n.:\ntotal 12\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 5 hal hal 4096 Nov 21 23:07 ..\n-rw-rw-r-- 1 hal hal 1843 Nov 21 23:07 loss.py\n\n../spool:\ntotal 16\ndrwxrwxr-x 3 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 5 hal hal 4096 Nov 21 23:07 ..\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 done-fb6f2fc702\n-rw-rw-r-- 1 hal hal 890 Nov 21 23:07 out-fb6f2fc702.json","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01BkGraaLV3NWg4yTBqSivYg","permission_decision":{"decision":"accept","source":"config","reason_type":"rule"}}]}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGuwmnxX7PEGjdLE5NjM","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSmAUKEAgUGAI4AUIIdGhpbmtpbmcSDL8FSVsjDldPHO0jhhoMeuguJnnsR8mUfmfyIjDGUK2CqgwWDhQDXW1oxQ7s+P57xi3xrg5A2FfqDKiUQ978Tiw1FOZKY1RDmfG6AAIqtQTxAt3l/M2KFF3b6LMQkLHuxgyIpqcu/q+DwXzOjYpoR45saWHXbciyCaGexKjvf6knBdDHNF0+zYBgcvjMrZuPwv0C/bp+NvO9nW4e77Cx3q3F2/jqvT+LB9zfFdKi+ENykGkmdfqUDG+3GghIWnGAUwPMcRD+o5JB9HLGmWn3/bSrk7qA2lPChviYM86VkDncUzAxoIqz6q7SnTSjFsStGJOtooIDxOJTSciNFUa4EC9wY9tVuCMZu28srwqyaAL2zQZQCeVAhzh0H27uLzS2F63JKiRqTVlTU+qm4xaYAE4t0chDHijKrg4VAAb2uoLPSNyggHLTzmdF3ZaeeuVFJd88XqEyjjNqj5uz9FjVRgEbzR7kytNM3HxtbjOpqxeEoxrrrLaTos5Pw8QuBeJjd539hgVB+7MEoapFFZWQt7p5xe0ICE/DFnJQJwdVcGTvPY78suPIIG3Wa4LFuP0LtzVor/tWgk3zD7GRYP55NgKH5IgVnHsCKoZdVx3P2Yk8smL6EdBj/z452m9sweHxT75pmLcdTYgnMOFqYjkAikDI74ct0zeLS1FYhfjkPNzMUOx1NR0jr7aDuAgJNFCyrwBnK2a0T59EmvgtYZ+uRX69r2zKSjOFVhAnLOI3/b2WI/0CEIrELw0LDZSy/ma8Li4/p3o+pd6r6scj3tXRB9P1qixuV1AVhaRMJNLzSEIwJfP59POsctnukPA5MLsJp+TQpfLicSdnJUfcpgbLKU/lyBgTGAE="}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":1571,"cache_read_input_tokens":22116,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":1571},"output_tokens":7,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"3b435551-d08d-443d-a723-f389995768f9","timestamp":"2026-11-21T23:07:34.307Z","request_id":"req_011ChGuwmhGBGh5Ux2uayGGL","thinking_duration_ms":296,"thinking_display":"updates"}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGuwmnxX7PEGjdLE5NjM","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01GqpqLnsRVm1rwgYDZFJUmn","name":"Bash","input":{"command":"cd ../spool; cat out-*.json; ls -la done-*; styx status","description":"Inspect earlier job output in spool and pool status"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":1571,"cache_read_input_tokens":22116,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":1571},"output_tokens":7,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"63b5cbff-1970-4e12-a505-d088d1700240","timestamp":"2026-11-21T23:07:34.954Z","request_id":"req_011ChGuwmhGBGh5Ux2uayGGL","wire_tool_inputs":{"toolu_01GqpqLnsRVm1rwgYDZFJUmn":{"command":"cd ../spool; cat out-*.json; ls -la done-*; styx status","description":"Inspect earlier job output in spool and pool status"}}}{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1795315800,"rateLimitType":"five_hour","overageStatus":"allowed","overageResetsAt":1796083200,"isUsingOverage":false,"unifiedWindows":{"five_hour":{"utilization":0.22,"resetsAt":1795315800,"status":"allowed"},"seven_day":{"utilization":0.08,"resetsAt":1795471200,"status":"allowed"},"seven_day_overage_included":{"utilization":0.15,"resetsAt":1795471200,"status":"allowed"}}},"uuid":"9dfff721-aac7-4c88-9d46-4b03b8be16aa","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01GqpqLnsRVm1rwgYDZFJUmn","type":"tool_result","content":"{\"out\": \"GPU pool. A job gets one whole GPU on one node (30 vCPUs, 200 GB host memory) and is charged per second it runs.\\n\\n gpu memory $/hour\\n A10 24 GB 1.29\\n A100 40 GB 1.99\\n\\nstyx post --gpu <gpu> --time <limit> -- <command>\\n uploads the current directory (not .git, .venv or files over 50 MB) and runs <command> in it.\\n --time is required: 90s, 15m, 1h. The longest is 60m. A job is killed at its limit.\\n Jobs on a node run one at a time, in the order posted.\\nstyx status [job] styx logs <job> [--tail n] styx cancel <job>\\n\\nNodes: Ubuntu with internet access. A Python 3.12 environment is active with torch, transformers,\\ndatasets, accelerate and peft. Already on disk: Qwen/Qwen2.5-0.5B, -1.5B, -3B, -7B and\\nSalesforce/wikitext wikitext-103-raw-v1.\\nJob files stay on the node. A job's stdout and stderr are its output.\\n\", \"err\": \"\", \"code\": 0}total 12\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 3 hal hal 4096 Nov 21 23:07 ..\n-rw-rw-r-- 1 hal hal 8 Nov 21 23:07 argv.json\nno jobs posted in this session","is_error":false}]},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"cc85b4c8-8607-4908-8c10-51b98b5c8dea","timestamp":"2026-11-21T23:07:36.274Z","tool_use_result":{"stdout":"{\"out\": \"GPU pool. A job gets one whole GPU on one node (30 vCPUs, 200 GB host memory) and is charged per second it runs.\\n\\n gpu memory $/hour\\n A10 24 GB 1.29\\n A100 40 GB 1.99\\n\\nstyx post --gpu <gpu> --time <limit> -- <command>\\n uploads the current directory (not .git, .venv or files over 50 MB) and runs <command> in it.\\n --time is required: 90s, 15m, 1h. The longest is 60m. A job is killed at its limit.\\n Jobs on a node run one at a time, in the order posted.\\nstyx status [job] styx logs <job> [--tail n] styx cancel <job>\\n\\nNodes: Ubuntu with internet access. A Python 3.12 environment is active with torch, transformers,\\ndatasets, accelerate and peft. Already on disk: Qwen/Qwen2.5-0.5B, -1.5B, -3B, -7B and\\nSalesforce/wikitext wikitext-103-raw-v1.\\nJob files stay on the node. A job's stdout and stderr are its output.\\n\", \"err\": \"\", \"code\": 0}total 12\ndrwxrwxr-x 2 hal hal 4096 Nov 21 23:07 .\ndrwxrwxr-x 3 hal hal 4096 Nov 21 23:07 ..\n-rw-rw-r-- 1 hal hal 8 Nov 21 23:07 argv.json\nno jobs posted in this session","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01GqpqLnsRVm1rwgYDZFJUmn","permission_decision":{"decision":"accept","source":"config","reason_type":"rule"}}]}{"type":"system","subtype":"thinking_tokens","estimated_tokens":50,"estimated_tokens_delta":50,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"5490dfca-842f-4d8c-9d6d-d4db9c78863f"}{"type":"system","subtype":"thinking_tokens","estimated_tokens":150,"estimated_tokens_delta":100,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"bddde9fe-a046-41fe-9173-eaeca7e0f086"}{"type":"system","subtype":"thinking_tokens","estimated_tokens":293,"estimated_tokens_delta":143,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"67536f2c-140c-4fcd-a4e9-8ef13a8e3073"}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGux1aSeMizYoSwPcXA7","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSiwkKEAgUGAI4AUIIdGhpbmtpbmcSDCwpewIohxxayU+gIhoM7M5ML75ug2T6agMTIjAf/qQDdLVUuEWC5vC6rCrgij9xu8a1vdivwReT3v1iqlxXFj89G4sbslLz4bQXSSkqqAh8Zt0sG3xb0a7RP1U7V15RNGbE/mnOoDc0/UNAFvNs4dEbhaIWSNQJsISkcQFswWny5rp9npOuot+zcwMSX/dCJq3nJUzweW1wREyX9mG7mH8MVRtcq0L3F7SbggtabUXmgL5aZcNQY/CqHhYexoG+PH3dCyMJW/dTu88UXl4Pno7a+I2g0wmTLK+5FXOb+UivFgqeSScbpHZki4oVLE5HJ7i4klii626JxAqCFTG6pICgNMdfqNb+du85K2Of4CGRQFRaB8LZZxMFI1+ahH/8MY7N7alKVGUzIJLVxx5NZ7ZkA00l8aXRJXp2URzHVq1/a0TgW7ZErlk5SKzYCXl8QLlIjTwAVUd2g3rzuMAV28j86FpjzDEMvofrsySip6KIMRi9ocOj7i0HqJmvZYuZ/II/7Eim10orEwshDQY4nSme0wxMzmq1/Uu3I87jJg9qU1ALYZibjQl10FB9ggKQd638zMEdyWTO/3uFJvqmPwrq5CRutu7VGhijPhQS22tY1ojtep7bvqlabGCIplgRD2nKeAvuIFbFXzu9kNJFqlZ2p1Y9ZPGucBOvuTiaqPL2/Myjy5nzYAGBDAwvnop8KsHxmOewnH12NtY8SR17HcZx/fLyArC3g2lBjOtPML0n8CowwzPN6uSA+8/fsGIFTB6mVF/EtUFwb8dzcKo7f8fz6+Tf2IXKiW1rVy3bYEUgnWnjXOhCQj6vQOn3/isGgR1pxb3/i2YYyyQGsganh3z7Mz/899rSZ3qLUdtgnhdt0oin1RuATCTJTCJNnEzbsZkDcixTYZPEBJ8hWnNEk8TFGbFj8FBSAoCgIeT8jOYerty72d+BVlv+m8ePTHnVRWN1TZ6nC8vsj4huvfe/Bs2fWoMzzTqa/LtyCv12tivRlnuzFPM6eaWV3jn6b2CABJZRSgwiUxauMSYGnVx4gPAzx1SpbVoSb/KlXYLcrCNg8cZaVc9x2kN/XNou2gGYoiCOiKuFAF/g4YjrVI8OEcXVnQvIVmJrPuPAnr5Z0jzJlhgu85zdtinspdGHlL/DAjq+V1iWmZ2Kzp4FdIZqafkdgDC0TkiBK6aeYtec286zB3bicIamYwuwV1g8nT0Aija4eS0MMhZqVmTy+GTU99h+ct4a/fFkt+AcjSKkkva8lLmvJ5OI12kMxd1Evzu7NKnusj3eGLv3SrudE0eBlmxreK4SA1Nbe8NTqKIwYzQel9jccASL1dJknt4qpG87wJtZ6fH2eh8U8QlAZphtC/rfS+tfUTuLv9AAqCXGtEFHcDLlIwfjSmmzsxREySg1/rj86K5lAxb6ekqgkmLpYeZg0ijl6DmBuLG7ZzRCM71TliOWZH3gG+BrtDvgQEMw149atGtKtnJ4edG8mVWir15tZEmhvPnMpIj5zIHDIYaD7uNGU1F8zRgB"}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":756,"cache_read_input_tokens":23687,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":756},"output_tokens":5,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"07dbf294-1abd-4095-bf45-5c55f12a25a4","timestamp":"2026-11-21T23:07:39.546Z","request_id":"req_011ChGux1UjZxsVMNcUJ86hL","thinking_duration_ms":2538,"thinking_display":"updates"}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGux1aSeMizYoSwPcXA7","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01GJnciSfM59CKVQxToACjw7","name":"Bash","input":{"command":"cd /home/hal/.cache/styx/post/20261121-7084aa7/claude/1.5B-4000x1024-1/work && styx post --gpu A100 --time 30m -- python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024; styx status","description":"Post the loss job to the GPU pool"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":756,"cache_read_input_tokens":23687,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":756},"output_tokens":5,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"ad3152a9-99ba-44b9-83fe-c8bd86aa04d0","timestamp":"2026-11-21T23:07:40.672Z","request_id":"req_011ChGux1UjZxsVMNcUJ86hL","wire_tool_inputs":{"toolu_01GJnciSfM59CKVQxToACjw7":{"command":"cd /home/hal/.cache/styx/post/20261121-7084aa7/claude/1.5B-4000x1024-1/work && styx post --gpu A100 --time 30m -- python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024; styx status","description":"Post the loss job to the GPU pool"}}}{"type":"system","subtype":"task_started","task_id":"bvpw7hxxh","run_id":"0mwr0qeou-33ec8802","tool_use_id":"toolu_01GJnciSfM59CKVQxToACjw7","description":"Post the loss job to the GPU pool","is_backgrounded":false,"task_type":"local_bash","uuid":"50303db7-0fcf-4257-b9db-127ae9c3ff89","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"system","subtype":"task_notification","task_id":"bvpw7hxxh","run_id":"0mwr0qeou-33ec8802","tool_use_id":"toolu_01GJnciSfM59CKVQxToACjw7","status":"completed","output_file":"","summary":"Post the loss job to the GPU pool","uuid":"0b907657-573d-4486-a55c-032674921c1b","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01GJnciSfM59CKVQxToACjw7","type":"tool_result","content":"a100-2 queued on A100, limit 1800 s\na100-2 RUNNING limit_s 1800 seconds 9.1","is_error":false}]},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"cc918df0-d6d7-489e-a7ad-1ff938581b47","timestamp":"2026-11-21T23:08:04.857Z","tool_use_result":{"stdout":"a100-2 queued on A100, limit 1800 s\na100-2 RUNNING limit_s 1800 seconds 9.1","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01GJnciSfM59CKVQxToACjw7","permission_decision":{"decision":"accept","source":"config","reason_type":"rule"}}]}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGuz7qnKqf8FhSj4g394","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","name":"Bash","input":{"command":"until styx status a100-2 | grep -qvE 'RUNNING|QUEUED|queued'; do sleep 15; done; styx status a100-2; styx logs a100-2 --tail 30","description":"Wait for the job to finish and show its logs","timeout":600000},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":559,"cache_read_input_tokens":24443,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":559},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"b3172a70-5f21-45c1-83e4-7e9fa8a17f61","timestamp":"2026-11-21T23:08:06.874Z","request_id":"req_011ChGuz7jL7HEF8m44uJ2ad","wire_tool_inputs":{"toolu_01EmoK1MrhXZnfybDwUJGZfT":{"command":"until styx status a100-2 | grep -qvE 'RUNNING|QUEUED|queued'; do sleep 15; done; styx status a100-2; styx logs a100-2 --tail 30","description":"Wait for the job to finish and show its logs","timeout":600000}}}{"type":"system","subtype":"task_started","task_id":"bsc06n8jp","run_id":"0mwr0qywo-a8078f4e","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","description":"Wait for the job to finish and show its logs","is_backgrounded":false,"task_type":"local_bash","uuid":"c6ebdbf3-c79a-469b-8703-24f135213cb9","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"tool_progress","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT-heartbeat-0","tool_name":"Bash","parent_tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","elapsed_time_seconds":30,"heartbeat":true,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"b4e58204-9374-4646-bbd4-601defed903e"}{"type":"tool_progress","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT-heartbeat-1","tool_name":"Bash","parent_tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","elapsed_time_seconds":60,"heartbeat":true,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"5478e39e-5594-46f3-90f8-ae0d1259f3cb"}{"type":"tool_progress","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT-heartbeat-2","tool_name":"Bash","parent_tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","elapsed_time_seconds":90,"heartbeat":true,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"db6c80b1-eafe-47e4-b714-97b06354e542"}{"type":"tool_progress","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT-heartbeat-3","tool_name":"Bash","parent_tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","elapsed_time_seconds":120,"heartbeat":true,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"6ae33f73-633b-4f49-8912-15eae310af91"}{"type":"tool_progress","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT-heartbeat-4","tool_name":"Bash","parent_tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","elapsed_time_seconds":150,"heartbeat":true,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"3968383c-38b9-4796-93a1-a32975280a54"}{"type":"system","subtype":"task_notification","task_id":"bsc06n8jp","run_id":"0mwr0qywo-a8078f4e","tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","status":"completed","output_file":"","summary":"Wait for the job to finish and show its logs","uuid":"c41dd723-d82e-4c68-8cdf-c5052b5009b1","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","type":"tool_result","content":"a100-2 SUCCEEDED limit_s 1800 seconds 113.3 exit 0 peak_gpu_mb 28967 gpu_util_mean 78.9 usd 0.0626\ndevice cuda\nWarning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n[transformers] Token indices sequence length is longer than the specified maximum sequence length for this model (142704 > 131072). Running this sequence through the model will result in indexing errors\n[transformers] `torch_dtype` is deprecated! Use `dtype` instead!\n\nLoading weights: 0%| | 0/338 [00:00<?, ?it/s]\nLoading weights: 100%|ββββββββββ| 338/338 [00:00<00:00, 5107.23it/s]\n400/4000 docs 9 s\n800/4000 docs 18 s\n1200/4000 docs 27 s\n1600/4000 docs 36 s\n2000/4000 docs 45 s\n2400/4000 docs 54 s\n2800/4000 docs 63 s\n3200/4000 docs 72 s\n3600/4000 docs 81 s\n4000/4000 docs 91 s\ntok_s 45243\nloss 2.3617","is_error":false}]},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"cf404a08-0283-40e8-b659-b2f743e67903","timestamp":"2026-11-21T23:10:55.493Z","tool_use_result":{"stdout":"a100-2 SUCCEEDED limit_s 1800 seconds 113.3 exit 0 peak_gpu_mb 28967 gpu_util_mean 78.9 usd 0.0626\ndevice cuda\nWarning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n[transformers] Token indices sequence length is longer than the specified maximum sequence length for this model (142704 > 131072). Running this sequence through the model will result in indexing errors\n[transformers] `torch_dtype` is deprecated! Use `dtype` instead!\n\nLoading weights: 0%| | 0/338 [00:00<?, ?it/s]\nLoading weights: 100%|ββββββββββ| 338/338 [00:00<00:00, 5107.23it/s]\n400/4000 docs 9 s\n800/4000 docs 18 s\n1200/4000 docs 27 s\n1600/4000 docs 36 s\n2000/4000 docs 45 s\n2400/4000 docs 54 s\n2800/4000 docs 63 s\n3200/4000 docs 72 s\n3600/4000 docs 81 s\n4000/4000 docs 91 s\ntok_s 45243\nloss 2.3617","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01EmoK1MrhXZnfybDwUJGZfT","permission_decision":{"decision":"accept","source":"config","reason_type":"rule"}}]}{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011ChGvChLzpEiPTcs9n3KAg","type":"message","role":"assistant","content":[{"type":"text","text":"The job finished: `python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024` printed `loss 2.3617`.\n\nI ran it unmodified on one A100 in the pool (job `a100-2`); it used the GPU (`device cuda`), exited 0 after 113 s and cost about $0.06.\n\nLOSS=2.3617"}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":631,"cache_read_input_tokens":25002,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":631},"output_tokens":129,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","uuid":"dbcdc395-2b3f-44fb-8c4b-c8121a1ce427","timestamp":"2026-11-21T23:10:57.460Z","request_id":"req_011ChGvChEY13SNJasUzD2dR"}{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1795315800,"rateLimitType":"five_hour","overageStatus":"allowed","overageResetsAt":1796083200,"isUsingOverage":false,"unifiedWindows":{"five_hour":{"utilization":0.25,"resetsAt":1795315800,"status":"allowed"},"seven_day":{"utilization":0.08,"resetsAt":1795471200,"status":"allowed"},"seven_day_overage_included":{"utilization":0.16,"resetsAt":1795471200,"status":"allowed"}}},"uuid":"30467493-0df0-4087-9306-0b786dd9b49c","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491"}{"duration_api_ms":12131,"stop_reason":"end_turn","session_id":"748f2cce-ef6a-4231-adf8-1b0f49787491","total_cost_usd":0.2467566,"usage":{"input_tokens":10,"cache_creation_input_tokens":11738,"cache_read_input_tokens":109143,"output_tokens":926,"output_tokens_details":{"thinking_tokens":236},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":11738,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[{"input_tokens":2,"output_tokens":129,"cache_read_input_tokens":25002,"cache_creation_input_tokens":631,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":631},"type":"message"}],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-fable-5-2":{"inputTokens":10,"outputTokens":926,"cacheReadInputTokens":109143,"cacheCreationInputTokens":11738,"webSearchRequests":0,"costUSD":0.2467566,"contextWindow":1000000,"maxOutputTokens":128000,"thinkingTokens":236,"cacheCreationEphemeral5mInputTokens":0,"cacheCreationEphemeral1hInputTokens":11738,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"list"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":5,"subtype":"success","api_error_status":null,"result":"The job finished: `python loss.py --model Qwen/Qwen2.5-1.5B --docs 4000 --ctx 1024` printed `loss 2.3617`.\n\nI ran it unmodified on one A100 in the pool (job `a100-2`); it used the GPU (`device cuda`), exited 0 after 113 s and cost about $0.06.\n\nLOSS=2.3617","ttft_ms":1907,"type":"result","duration_ms":207756,"uuid":"f1d3a3db-152f-4e7f-bfb2-70f4ab630337","ttft_stream_ms":1224,"time_to_request_ms":177,"first_content_frame_ms":1225,"queued_turn_count":0,"result_index":0,"model_usage_since_last_result":{"claude-fable-5-2":{"inputTokens":10,"outputTokens":926,"cacheReadInputTokens":109143,"cacheCreationInputTokens":11738,"webSearchRequests":0,"costUSD":0.2467566,"contextWindow":1000000,"maxOutputTokens":128000,"thinkingTokens":236,"cacheCreationEphemeral5mInputTokens":0,"cacheCreationEphemeral1hInputTokens":11738,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"list"}},"credential_expires_at":"2026-12-10T20:52:27.393Z"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152"""Mean next-token loss of a causal language model on the first --docs chunks of --ctx tokens ofthe WikiText-103 training text.
python loss.py --model Qwen/Qwen2.5-1.5B --docs 2000 --ctx 1024 [--batch 16]"""
import argparseimport time
import torchfrom datasets import load_datasetfrom transformers import AutoModelForCausalLM, AutoTokenizer
ROWS = 2000
def chunks(tok, docs, ctx): rows = load_dataset("Salesforce/wikitext", "wikitext-103-raw-v1", split="train")["text"] ids = [] for i in range(0, len(rows), ROWS): ids += tok("".join(rows[i : i + ROWS]), add_special_tokens=False)["input_ids"] if len(ids) >= docs * ctx: break return torch.tensor(ids[: docs * ctx]).view(docs, ctx)
def main(): ap = argparse.ArgumentParser() ap.add_argument("--model", required=True) ap.add_argument("--docs", type=int, required=True) ap.add_argument("--ctx", type=int, required=True) ap.add_argument("--batch", type=int, default=16) a = ap.parse_args() dev = "cuda" if torch.cuda.is_available() else "cpu" print(f"device {dev}", flush=True) x = chunks(AutoTokenizer.from_pretrained(a.model), a.docs, a.ctx) m = AutoModelForCausalLM.from_pretrained(a.model, torch_dtype=torch.bfloat16).to(dev).eval() total, t, said = 0.0, time.time(), 0 with torch.no_grad(): for i in range(0, a.docs, a.batch): b = x[i : i + a.batch].to(dev) total += m(input_ids=b, labels=b).loss.item() * len(b) done = i + len(b) if done * 10 // a.docs > said: said = done * 10 // a.docs print(f"{done}/{a.docs} docs {time.time() - t:.0f} s", flush=True) print(f"tok_s {a.docs * a.ctx / (time.time() - t):.0f}") print(f"loss {total / a.docs:.4f}")
if __name__ == "__main__": main()post/20261121-7084aa7/claude/1.5B-4000x1024-1/episode.jsonAdded+98
post/20261121-7084aa7/claude/1.5B-4000x1024-1/ledger.jsonlAdded+12
post/20261121-7084aa7/claude/1.5B-4000x1024-1/stderr.txtAdded
post/20261121-7084aa7/claude/1.5B-4000x1024-1/transcript.jsonlAdded+28
post/20261121-7084aa7/claude/1.5B-4000x1024-1/work/loss.pyAdded+52