-
Notifications
You must be signed in to change notification settings - Fork 0
docs(kubeflow): add Trainer v2 training runtime catalog #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| apiVersion: trainer.kubeflow.org/v1alpha1 | ||
| kind: TrainingRuntime | ||
| metadata: | ||
| name: llamafactory0.9-cann8.5-arm64 | ||
| namespace: kubeflow-admin-cpaas-io | ||
| labels: | ||
| trainer.kubeflow.org/framework: torch | ||
| alauda.io/training-runtime: llamafactory0.9-cann8.5-arm64 | ||
| spec: | ||
| mlPolicy: | ||
| numNodes: 1 | ||
| torch: | ||
| numProcPerNode: auto | ||
| template: | ||
| spec: | ||
| replicatedJobs: | ||
| - name: node | ||
| template: | ||
| metadata: | ||
| labels: | ||
| trainer.kubeflow.org/trainjob-ancestor-step: trainer | ||
| spec: | ||
| backoffLimit: 0 | ||
| template: | ||
| spec: | ||
| schedulerName: hami-scheduler | ||
| runtimeClassName: ascend | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| fsGroup: 1001 | ||
| containers: | ||
| - name: node | ||
| image: docker.io/alaudadockerhub/llamafactory0.9-cann8.5-arm64:v0.1.0 | ||
| command: | ||
| - bash | ||
| - -c | ||
| - | | ||
| set -ex | ||
| python -c "import torch, torch_npu, llamafactory; print('torch', torch.__version__, 'torch_npu', torch_npu.__version__, 'lf', llamafactory.__version__, 'npu_available', torch_npu.npu.is_available())" | ||
| llamafactory-cli version || true | ||
| resources: | ||
| requests: | ||
| cpu: "1" | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: "4" | ||
| memory: 8Gi | ||
| huawei.com/Ascend910B4: "1" | ||
| huawei.com/Ascend910B4-memory: "8192" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: [ALL] | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| volumeMounts: | ||
| - { name: workspace, mountPath: /workspace } | ||
| - { name: dshm, mountPath: /dev/shm } | ||
| volumes: | ||
| - { name: workspace, emptyDir: {} } | ||
| - name: dshm | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: 2Gi |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,81 @@ | ||||||
| apiVersion: trainer.kubeflow.org/v1alpha1 | ||||||
| kind: TrainingRuntime | ||||||
| metadata: | ||||||
| name: llamafactory0.9-cu126-amd64 | ||||||
| namespace: kubeflow-admin-cpaas-io | ||||||
| labels: | ||||||
| trainer.kubeflow.org/framework: torch | ||||||
| alauda.io/training-runtime: llamafactory0.9-cu126-amd64 | ||||||
| spec: | ||||||
| mlPolicy: | ||||||
| numNodes: 1 | ||||||
| torch: | ||||||
| numProcPerNode: auto | ||||||
| template: | ||||||
| spec: | ||||||
| replicatedJobs: | ||||||
| - name: node | ||||||
| template: | ||||||
| metadata: | ||||||
| labels: | ||||||
| trainer.kubeflow.org/trainjob-ancestor-step: trainer | ||||||
| spec: | ||||||
| backoffLimit: 0 | ||||||
| template: | ||||||
| spec: | ||||||
| securityContext: | ||||||
| runAsNonRoot: true | ||||||
| runAsUser: 1000 | ||||||
| runAsGroup: 1000 | ||||||
| fsGroup: 1000 | ||||||
| containers: | ||||||
| - name: node | ||||||
| image: docker.io/alaudadockerhub/llamafactory0.9-cu126-amd64:v0.1.0 | ||||||
| command: | ||||||
| - bash | ||||||
| - -c | ||||||
| - | | ||||||
| set -ex | ||||||
| # Synthetic identity SFT smoke. Writes a 4-row alpaca dataset, fine-tunes | ||||||
| # qwen-style chat template against an empty config to exercise the | ||||||
| # LLaMA-Factory CLI without downloading a real model. | ||||||
| mkdir -p /tmp/lf | ||||||
| cat >/tmp/lf/dataset_info.json <<'JSON' | ||||||
| {"identity_smoke": {"file_name": "identity_smoke.json"}} | ||||||
| JSON | ||||||
| cat >/tmp/lf/identity_smoke.json <<'JSON' | ||||||
| [ | ||||||
| {"instruction":"Who are you?","input":"","output":"I am Alauda AI."}, | ||||||
| {"instruction":"Where do you run?","input":"","output":"On Kubeflow Trainer v2."}, | ||||||
| {"instruction":"What framework powers you?","input":"","output":"LLaMA-Factory on PyTorch."}, | ||||||
| {"instruction":"What device?","input":"","output":"NVIDIA GPU via CUDA 12.6."} | ||||||
| ] | ||||||
| JSON | ||||||
| python -c "import llamafactory, torch; print('lf', llamafactory.__version__, 'torch', torch.__version__, 'cuda', torch.cuda.is_available())" | ||||||
| llamafactory-cli version || true | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not swallow Line 55 masks command failures with Suggested fix- llamafactory-cli version || true
+ llamafactory-cli version📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| resources: | ||||||
| requests: | ||||||
| cpu: "1" | ||||||
| memory: 4Gi | ||||||
| limits: | ||||||
| cpu: "4" | ||||||
| memory: 8Gi | ||||||
| nvidia.com/gpualloc: 1 | ||||||
| nvidia.com/gpucores: 50 | ||||||
| nvidia.com/gpumem: "8192" | ||||||
| securityContext: | ||||||
| allowPrivilegeEscalation: false | ||||||
| capabilities: | ||||||
| drop: [ALL] | ||||||
| runAsNonRoot: true | ||||||
| seccompProfile: | ||||||
| type: RuntimeDefault | ||||||
| volumeMounts: | ||||||
| - { name: workspace, mountPath: /workspace } | ||||||
| - { name: dshm, mountPath: /dev/shm } | ||||||
| volumes: | ||||||
| - { name: workspace, emptyDir: {} } | ||||||
| - name: dshm | ||||||
| emptyDir: | ||||||
| medium: Memory | ||||||
| sizeLimit: 2Gi | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| apiVersion: trainer.kubeflow.org/v1alpha1 | ||
| kind: TrainingRuntime | ||
| metadata: | ||
| name: mindspeed-llm-cann8.5-arm64 | ||
| namespace: kubeflow-admin-cpaas-io | ||
| labels: | ||
| trainer.kubeflow.org/framework: torch | ||
| alauda.io/training-runtime: mindspeed-llm-cann8.5-arm64 | ||
| spec: | ||
| mlPolicy: | ||
| numNodes: 1 | ||
| torch: | ||
| numProcPerNode: auto | ||
| template: | ||
| spec: | ||
| replicatedJobs: | ||
| - name: node | ||
| template: | ||
| metadata: | ||
| labels: | ||
| trainer.kubeflow.org/trainjob-ancestor-step: trainer | ||
| spec: | ||
| backoffLimit: 0 | ||
| template: | ||
| spec: | ||
| schedulerName: hami-scheduler | ||
| runtimeClassName: ascend | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| fsGroup: 1001 | ||
| containers: | ||
| - name: node | ||
| image: docker.io/alaudadockerhub/mindspeed-llm-cann8.5-arm64:v0.1.0 | ||
| command: | ||
| - bash | ||
| - -c | ||
| - | | ||
| set -ex | ||
| python -c "import torch, torch_npu, megatron, mindspeed, mindspeed_llm; print('torch', torch.__version__, 'torch_npu', torch_npu.__version__, 'megatron', megatron.__version__, 'mindspeed_llm', mindspeed_llm.__version__)" | ||
| resources: | ||
| requests: | ||
| cpu: "1" | ||
| memory: 4Gi | ||
| limits: | ||
| cpu: "4" | ||
| memory: 8Gi | ||
| huawei.com/Ascend910B4: "1" | ||
| huawei.com/Ascend910B4-memory: "8192" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: [ALL] | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| volumeMounts: | ||
| - { name: workspace, mountPath: /workspace } | ||
| - { name: dshm, mountPath: /dev/shm } | ||
| volumes: | ||
| - { name: workspace, emptyDir: {} } | ||
| - name: dshm | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: 2Gi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| apiVersion: trainer.kubeflow.org/v1alpha1 | ||
| kind: TrainingRuntime | ||
| metadata: | ||
| name: torch2.6-cann8.5-arm64 | ||
| namespace: kubeflow-admin-cpaas-io | ||
| labels: | ||
| trainer.kubeflow.org/framework: torch | ||
| alauda.io/training-runtime: torch2.6-cann8.5-arm64 | ||
| spec: | ||
| mlPolicy: | ||
| numNodes: 1 | ||
| torch: | ||
| numProcPerNode: auto | ||
| template: | ||
| spec: | ||
| replicatedJobs: | ||
| - name: node | ||
| template: | ||
| metadata: | ||
| labels: | ||
| trainer.kubeflow.org/trainjob-ancestor-step: trainer | ||
| spec: | ||
| backoffLimit: 0 | ||
| template: | ||
| spec: | ||
| schedulerName: hami-scheduler | ||
| runtimeClassName: ascend | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| fsGroup: 1001 | ||
| containers: | ||
| - name: node | ||
| image: docker.io/alaudadockerhub/torch2.6-cann8.5-arm64:v0.1.0 | ||
| command: | ||
| - python | ||
| - -c | ||
| - | | ||
| import os, torch | ||
| try: | ||
| import torch_npu | ||
| import torch_npu.utils | ||
| print(f"torch={torch.__version__} torch_npu={torch_npu.__version__}") | ||
| print(f"npu_available={torch_npu.npu.is_available()} count={torch_npu.npu.device_count()}") | ||
| if torch_npu.npu.is_available(): | ||
| x = torch.randn(1024, 1024).npu() | ||
| y = x @ x.T | ||
| print(f"matmul ok shape={tuple(y.shape)} mean={y.mean().item():.4f}") | ||
| except Exception as e: | ||
| print(f"torch_npu probe failed: {e}") | ||
| raise | ||
| resources: | ||
| requests: | ||
| cpu: "1" | ||
| memory: 2Gi | ||
| limits: | ||
| cpu: "4" | ||
| memory: 8Gi | ||
| huawei.com/Ascend910B4: "1" | ||
| huawei.com/Ascend910B4-memory: "8192" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: [ALL] | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| volumeMounts: | ||
| - { name: workspace, mountPath: /workspace } | ||
| - { name: dshm, mountPath: /dev/shm } | ||
| volumes: | ||
| - { name: workspace, emptyDir: {} } | ||
| - name: dshm | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: 1Gi |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||||||||||||||||
| apiVersion: trainer.kubeflow.org/v1alpha1 | ||||||||||||||||||||
| kind: TrainingRuntime | ||||||||||||||||||||
| metadata: | ||||||||||||||||||||
| name: torch2.6-cu126-amd64 | ||||||||||||||||||||
| namespace: kubeflow-admin-cpaas-io | ||||||||||||||||||||
| labels: | ||||||||||||||||||||
| trainer.kubeflow.org/framework: torch | ||||||||||||||||||||
| alauda.io/training-runtime: torch2.6-cu126-amd64 | ||||||||||||||||||||
| spec: | ||||||||||||||||||||
| mlPolicy: | ||||||||||||||||||||
| numNodes: 1 | ||||||||||||||||||||
| torch: | ||||||||||||||||||||
| numProcPerNode: auto | ||||||||||||||||||||
| template: | ||||||||||||||||||||
| spec: | ||||||||||||||||||||
| replicatedJobs: | ||||||||||||||||||||
| - name: node | ||||||||||||||||||||
| template: | ||||||||||||||||||||
| metadata: | ||||||||||||||||||||
| labels: | ||||||||||||||||||||
| trainer.kubeflow.org/trainjob-ancestor-step: trainer | ||||||||||||||||||||
| spec: | ||||||||||||||||||||
| backoffLimit: 0 | ||||||||||||||||||||
| template: | ||||||||||||||||||||
| spec: | ||||||||||||||||||||
| securityContext: | ||||||||||||||||||||
| runAsNonRoot: true | ||||||||||||||||||||
| runAsUser: 1000 | ||||||||||||||||||||
| runAsGroup: 1000 | ||||||||||||||||||||
| fsGroup: 1000 | ||||||||||||||||||||
| containers: | ||||||||||||||||||||
| - name: node | ||||||||||||||||||||
| image: docker.io/alaudadockerhub/torch2.6-cu126-amd64:v0.1.0 | ||||||||||||||||||||
| command: | ||||||||||||||||||||
| - python | ||||||||||||||||||||
| - -c | ||||||||||||||||||||
| - | | ||||||||||||||||||||
| import torch, os | ||||||||||||||||||||
| print(f"torch={torch.__version__} cuda={torch.cuda.is_available()} devices={torch.cuda.device_count()}") | ||||||||||||||||||||
| print(f"PET_NNODES={os.environ.get('PET_NNODES')} PET_NODE_RANK={os.environ.get('PET_NODE_RANK')}") | ||||||||||||||||||||
| if torch.cuda.is_available(): | ||||||||||||||||||||
| x = torch.randn(1024, 1024, device='cuda') | ||||||||||||||||||||
| y = x @ x.T | ||||||||||||||||||||
| print(f"matmul ok, shape={tuple(y.shape)}, mean={y.mean().item():.4f}") | ||||||||||||||||||||
|
Comment on lines
+41
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fail fast when CUDA is unavailable in the smoke runtime. Line 41 currently makes GPU validation optional; if CUDA is unavailable, the container still exits successfully, so the smoke TrainJob can pass with a broken GPU runtime. Suggested fix- if torch.cuda.is_available():
- x = torch.randn(1024, 1024, device='cuda')
- y = x @ x.T
- print(f"matmul ok, shape={tuple(y.shape)}, mean={y.mean().item():.4f}")
+ if not torch.cuda.is_available() or torch.cuda.device_count() < 1:
+ raise SystemExit("CUDA is not available; smoke check failed")
+ x = torch.randn(1024, 1024, device='cuda')
+ y = x @ x.T
+ print(f"matmul ok, shape={tuple(y.shape)}, mean={y.mean().item():.4f}")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| resources: | ||||||||||||||||||||
| requests: | ||||||||||||||||||||
| cpu: "1" | ||||||||||||||||||||
| memory: 2Gi | ||||||||||||||||||||
| limits: | ||||||||||||||||||||
| cpu: "2" | ||||||||||||||||||||
| memory: 4Gi | ||||||||||||||||||||
| nvidia.com/gpualloc: 1 | ||||||||||||||||||||
| nvidia.com/gpucores: 50 | ||||||||||||||||||||
| nvidia.com/gpumem: "8192" | ||||||||||||||||||||
| securityContext: | ||||||||||||||||||||
| allowPrivilegeEscalation: false | ||||||||||||||||||||
| capabilities: | ||||||||||||||||||||
| drop: [ALL] | ||||||||||||||||||||
| runAsNonRoot: true | ||||||||||||||||||||
| seccompProfile: | ||||||||||||||||||||
| type: RuntimeDefault | ||||||||||||||||||||
| volumeMounts: | ||||||||||||||||||||
| - { name: workspace, mountPath: /workspace } | ||||||||||||||||||||
| - { name: dshm, mountPath: /dev/shm } | ||||||||||||||||||||
| volumes: | ||||||||||||||||||||
| - { name: workspace, emptyDir: {} } | ||||||||||||||||||||
| - name: dshm | ||||||||||||||||||||
| emptyDir: | ||||||||||||||||||||
| medium: Memory | ||||||||||||||||||||
| sizeLimit: 1Gi | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the smoke comment with executed behavior.
Lines 39-41 say this block fine-tunes, but the script only prepares data and checks versions. This mismatch can mislead debugging and runbook expectations.
Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents