trainfabric 0.1.42 → 0.1.43
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/dist/index.cjs +36 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9291,7 +9291,7 @@ function buildComputeSpec(options) {
|
|
|
9291
9291
|
|
|
9292
9292
|
// src/index.ts
|
|
9293
9293
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9294
|
-
var CLI_VERSION = "0.1.
|
|
9294
|
+
var CLI_VERSION = "0.1.43";
|
|
9295
9295
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9296
9296
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9297
9297
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -9667,6 +9667,39 @@ function requireProjectId(options, config) {
|
|
|
9667
9667
|
}
|
|
9668
9668
|
return projectId;
|
|
9669
9669
|
}
|
|
9670
|
+
function optionWasProvided(command, optionName) {
|
|
9671
|
+
return command.getOptionValueSource(optionName) === "cli";
|
|
9672
|
+
}
|
|
9673
|
+
function assertQuoteCreateHasNoLaunchOverrides(options, command) {
|
|
9674
|
+
if (!options.quote) {
|
|
9675
|
+
return;
|
|
9676
|
+
}
|
|
9677
|
+
const launchShapingOptions = [
|
|
9678
|
+
["dataset", "--dataset"],
|
|
9679
|
+
["model", "--model"],
|
|
9680
|
+
["eval", "--eval"],
|
|
9681
|
+
["epochs", "--epochs"],
|
|
9682
|
+
["lr", "--lr"],
|
|
9683
|
+
["gpus", "--gpus"],
|
|
9684
|
+
["nodes", "--nodes"],
|
|
9685
|
+
["accelerator", "--accelerator"],
|
|
9686
|
+
["minMemory", "--min-memory"],
|
|
9687
|
+
["precision", "--precision"],
|
|
9688
|
+
["interconnect", "--interconnect"],
|
|
9689
|
+
["mode", "--mode"],
|
|
9690
|
+
["repo", "--repo"],
|
|
9691
|
+
["git", "--git"],
|
|
9692
|
+
["branch", "--branch"]
|
|
9693
|
+
];
|
|
9694
|
+
const provided = launchShapingOptions.filter(([name]) => optionWasProvided(command, name)).map(([, flag]) => flag);
|
|
9695
|
+
if (provided.length > 0) {
|
|
9696
|
+
throw new Error(
|
|
9697
|
+
`Do not combine --quote with launch-shaping flags (${provided.join(
|
|
9698
|
+
", "
|
|
9699
|
+
)}). The accepted quote already locks dataset, model, compute, mode, source, and hyperparameters. Request a new quote for different launch settings.`
|
|
9700
|
+
);
|
|
9701
|
+
}
|
|
9702
|
+
}
|
|
9670
9703
|
function buildRunInput(options, config = loadConfig()) {
|
|
9671
9704
|
const sourceOptions = buildSourceOptions(options);
|
|
9672
9705
|
const quoteId = options.quote === void 0 ? void 0 : normalizeId(options.quote, "quote", "Pricing quote ID");
|
|
@@ -10019,8 +10052,9 @@ program2.command("datasets:upload").argument("<file>").option("--project <projec
|
|
|
10019
10052
|
});
|
|
10020
10053
|
printJson(dataset);
|
|
10021
10054
|
});
|
|
10022
|
-
program2.command("runs:create").option("--project <projectId>").option("--dataset <datasetId>").option("--model <baseModel>").option("--eval <evalDatasetId>").option("--epochs <epochs>", "number of epochs", "3").option("--lr <lr>", "learning rate", "0.0002").option("--gpus <gpuCount>", "gpu count", "1").option("--nodes <nodeCount>", "node count", "1").option("--accelerator <acceleratorClass>", "optional hard accelerator constraint (for example: a10g, a100, h100)").option("--min-memory <gigabytes>", "minimum GPU memory in GB").option("--precision <precision>", "fp16_bf16, fp8, or fp32").option("--interconnect <interconnect>", "pcie or nvlink").option("--mode <mode>", "efficient, balanced, or power").option("--quote <pricingQuoteId>", "launch the exact accepted quote id from runs:quote").option("--repo <path>", "local repo path for runtime autodetect").option("--git <url>", "git repo URL for runtime metadata").option("--branch <branch>", "git branch for runtime metadata").option("--yes", "confirm that you reviewed pricing with runs:quote --summary and accept fluctuating realized usage").description("Create a training run").action(async (options) => {
|
|
10055
|
+
program2.command("runs:create").option("--project <projectId>").option("--dataset <datasetId>").option("--model <baseModel>").option("--eval <evalDatasetId>").option("--epochs <epochs>", "number of epochs", "3").option("--lr <lr>", "learning rate", "0.0002").option("--gpus <gpuCount>", "gpu count", "1").option("--nodes <nodeCount>", "node count", "1").option("--accelerator <acceleratorClass>", "optional hard accelerator constraint (for example: a10g, a100, h100)").option("--min-memory <gigabytes>", "minimum GPU memory in GB").option("--precision <precision>", "fp16_bf16, fp8, or fp32").option("--interconnect <interconnect>", "pcie or nvlink").option("--mode <mode>", "efficient, balanced, or power").option("--quote <pricingQuoteId>", "launch the exact accepted quote id from runs:quote").option("--repo <path>", "local repo path for runtime autodetect").option("--git <url>", "git repo URL for runtime metadata").option("--branch <branch>", "git branch for runtime metadata").option("--yes", "confirm that you reviewed pricing with runs:quote --summary and accept fluctuating realized usage").description("Create a training run").action(async (options, command) => {
|
|
10023
10056
|
const config = loadConfig();
|
|
10057
|
+
assertQuoteCreateHasNoLaunchOverrides(options, command);
|
|
10024
10058
|
const runInput = buildRunInput(options, config);
|
|
10025
10059
|
if (!options.yes) {
|
|
10026
10060
|
throw new Error("Refusing to launch without explicit cost acceptance. Run `trainfabric runs:quote --summary ...` first, then rerun `runs:create` with --yes.");
|