trainfabric 0.1.32 → 0.1.34
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 +10 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9156,11 +9156,14 @@ var PRECISION_MODES = /* @__PURE__ */ new Set(["fp16_bf16", "fp8", "fp32"]);
|
|
|
9156
9156
|
var INTERCONNECT_TYPES = /* @__PURE__ */ new Set(["pcie", "nvlink"]);
|
|
9157
9157
|
var BASE_MODELS = new Set(baseModels);
|
|
9158
9158
|
var TRAINING_MODES = new Set(trainingModes);
|
|
9159
|
-
function normalizePositiveInteger(value, label, fallback) {
|
|
9159
|
+
function normalizePositiveInteger(value, label, fallback, max) {
|
|
9160
9160
|
const parsed = Number(value ?? String(fallback));
|
|
9161
9161
|
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
9162
9162
|
throw new Error(`${label} must be a positive integer.`);
|
|
9163
9163
|
}
|
|
9164
|
+
if (max !== void 0 && parsed > max) {
|
|
9165
|
+
throw new Error(`${label} must be between 1 and ${max}.`);
|
|
9166
|
+
}
|
|
9164
9167
|
return parsed;
|
|
9165
9168
|
}
|
|
9166
9169
|
function normalizeOptionalPositiveNumber(value, label) {
|
|
@@ -9215,8 +9218,11 @@ function normalizeLearningRate(lr) {
|
|
|
9215
9218
|
return parsed;
|
|
9216
9219
|
}
|
|
9217
9220
|
function buildComputeSpec(options) {
|
|
9218
|
-
const gpuCount = normalizePositiveInteger(options.gpus, "GPU count", 1);
|
|
9219
|
-
const nodeCount = normalizePositiveInteger(options.nodes, "Node count", 1);
|
|
9221
|
+
const gpuCount = normalizePositiveInteger(options.gpus, "GPU count", 1, 64);
|
|
9222
|
+
const nodeCount = normalizePositiveInteger(options.nodes, "Node count", 1, 16);
|
|
9223
|
+
if (nodeCount > gpuCount) {
|
|
9224
|
+
throw new Error("Node count cannot exceed GPU count. Request at least one GPU per node.");
|
|
9225
|
+
}
|
|
9220
9226
|
const compute = {
|
|
9221
9227
|
gpuCount,
|
|
9222
9228
|
nodeCount,
|
|
@@ -9249,7 +9255,7 @@ function buildComputeSpec(options) {
|
|
|
9249
9255
|
|
|
9250
9256
|
// src/index.ts
|
|
9251
9257
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9252
|
-
var CLI_VERSION = "0.1.
|
|
9258
|
+
var CLI_VERSION = "0.1.34";
|
|
9253
9259
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9254
9260
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9255
9261
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|