@platforma-open/milaboratories.gpu-test.model 0.1.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/.turbo/turbo-build.log +16 -0
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-type-check.log +6 -0
- package/dist/bundle.js +8147 -0
- package/dist/bundle.js.map +1 -0
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/model.json +1 -0
- package/eslint.config.mjs +4 -0
- package/package.json +37 -0
- package/src/index.ts +63 -0
- package/tsconfig.json +9 -0
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@platforma-open/milaboratories.gpu-test.model",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Block model",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"sources": "./src/index.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./dist/*": "./dist/*"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@platforma-sdk/model": "1.53.15"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@milaboratories/ts-builder": "1.2.9",
|
|
22
|
+
"@milaboratories/ts-configs": "1.2.1",
|
|
23
|
+
"@platforma-sdk/block-tools": "2.7.2",
|
|
24
|
+
"@platforma-sdk/eslint-config": "1.2.0",
|
|
25
|
+
"eslint": "^9.25.1",
|
|
26
|
+
"vitest": "^4.0.7",
|
|
27
|
+
"typescript": "~5.6.3"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "ts-builder build --target block-model && block-tools build-model",
|
|
31
|
+
"watch": "ts-builder build --target block-model --watch",
|
|
32
|
+
"type-check": "ts-builder type-check --target block-model",
|
|
33
|
+
"test": "vitest",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"do-pack": "shx rm -f *.tgz && pnpm pack && shx mv *.tgz package.tgz"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BlockModel } from '@platforma-sdk/model';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- GPU config will be added in Step 8
|
|
4
|
+
export type BlockArgs = {};
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- UI state will be added in Step 8
|
|
7
|
+
export type UiState = {};
|
|
8
|
+
|
|
9
|
+
export const model = BlockModel.create()
|
|
10
|
+
.withArgs<BlockArgs>({})
|
|
11
|
+
.withUiState<UiState>({})
|
|
12
|
+
.argsValid(() => true)
|
|
13
|
+
|
|
14
|
+
.output('gpuLog', (ctx) => ctx.outputs?.resolve('gpuLog')?.getLogHandle())
|
|
15
|
+
.output('gpuInfo', (ctx) => ctx.outputs?.resolve('gpuInfo')?.getDataAsJson<GpuReport>())
|
|
16
|
+
.output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
|
|
17
|
+
|
|
18
|
+
.title(() => 'GPU Test')
|
|
19
|
+
.sections(() => [{ type: 'link' as const, href: '/' as const, label: 'GPU Info' }])
|
|
20
|
+
.done(1);
|
|
21
|
+
|
|
22
|
+
export interface GpuReport {
|
|
23
|
+
gpu_available: boolean;
|
|
24
|
+
torch_cuda: {
|
|
25
|
+
available: boolean;
|
|
26
|
+
device_count: number;
|
|
27
|
+
cuda_version: string | null;
|
|
28
|
+
cudnn_version: string | null;
|
|
29
|
+
devices: Array<{
|
|
30
|
+
index: number;
|
|
31
|
+
name: string;
|
|
32
|
+
total_memory_mb: number;
|
|
33
|
+
free_memory_mb?: number;
|
|
34
|
+
major: number;
|
|
35
|
+
minor: number;
|
|
36
|
+
multi_processor_count: number;
|
|
37
|
+
}>;
|
|
38
|
+
error?: string;
|
|
39
|
+
};
|
|
40
|
+
nvidia_smi: {
|
|
41
|
+
available: boolean;
|
|
42
|
+
driver_version: string | null;
|
|
43
|
+
devices: Array<{
|
|
44
|
+
index: number;
|
|
45
|
+
name: string;
|
|
46
|
+
memory_total_mb: number;
|
|
47
|
+
memory_free_mb: number;
|
|
48
|
+
memory_used_mb: number;
|
|
49
|
+
temperature_c: number | null;
|
|
50
|
+
}>;
|
|
51
|
+
error?: string;
|
|
52
|
+
};
|
|
53
|
+
environment: Record<string, string>;
|
|
54
|
+
benchmark: {
|
|
55
|
+
ran: boolean;
|
|
56
|
+
matrix_size?: number;
|
|
57
|
+
cpu_time_ms?: number;
|
|
58
|
+
gpu_time_ms?: number;
|
|
59
|
+
speedup?: number;
|
|
60
|
+
skipped?: string;
|
|
61
|
+
error?: string;
|
|
62
|
+
};
|
|
63
|
+
}
|