Skip to content
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

Sakkara support in MLBatch is added #117

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tools/pytorchjob-generator/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ annotations:
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
{{- if .Values.bypassCoscheduler }}
schedulerName: default-scheduler
schedulerName: {{ .Values.schedulerName }}
{{- end }}
priorityClassName: {{ .Values.priority }}
affinity:
Expand Down Expand Up @@ -79,8 +79,14 @@ envFrom:
- configMapRef:
name: {{ .Values.ncclGdrEnvConfigMap }}
{{- end }}
{{- if or .Values.environmentVariables .Values.sshGitCloneConfig .Values.mountNVMe .Values.topologyFileConfigMap }}
{{- if or .Values.environmentVariables .Values.sshGitCloneConfig .Values.mountNVMe .Values.topologyFileConfigMap ( eq .Values.schedulerName "sakkara" ) }}
env:
{{- if eq .Values.schedulerName "sakkara" }}
- name: SAKKARA_RANK
valueFrom:
fieldRef:
fieldPath: metadata.labels['sakkara.member.rank']
{{- end }}
{{- if .Values.topologyFileConfigMap }}
- name: NCCL_TOPO_FILE
value: /var/run/nvidia-topologyd/virtualTopology.xml
Expand Down Expand Up @@ -144,6 +150,10 @@ command:
#
# User commands
#
{{- if eq .Values.schedulerName "sakkara" }}
echo "Sakkara is enabled: using Sakkara-assigned rank instead of the default PyTorchJob rank"
export RANK=$SAKKARA_RANK
{{- end }}
{{- range $command := .Values.setupCommands }}
{{ $command }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions tools/pytorchjob-generator/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
{ "type": "array" }
]},
"bypassCoscheduler": { "type": "boolean" },
"schedulerName": { "oneOf": [
{ "type": "null" },
{ "type": "string", "enum": ["sakkara", "default-scheduler" ] }
]},
"serviceAccountName": { "oneOf" : [
{ "type": "null" },
{ "$ref": "#/$defs/rfc1123Label" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace: my-namespace # namespace to deploy to (required)
jobName: my-job # name of the generated AppWrapper and PyTorchJob objects (required)
queueName: default-queue # local queue to submit to (default: default-queue)

bypassCoscheduler: true
schedulerName: sakkara
# If additional constraints are used, specify the configmap here:
#customLabels:
# - key: sakkara.group.name
# value: my-topogrp-0

numPods: 4 # total pod count including master and worker pods (default: 1)
numCpusPerPod: 500m # requested number of cpus per pod (default: 1)
numGpusPerPod: 8 # requested number of gpus per pod (default: 0)
totalMemoryPerPod: 1Gi # requested amount of memory per pod (default: 1Gi)

priority: default-priority # default-priority (default), low-priority, or high-priority

# container image for the pods (required)
containerImage: ghcr.io/foundation-model-stack/base:pytorch-latest-nightly-20230126

# setup commands to run in each pod (optional)
setupCommands:
- git clone https://github.com/dbarnett/python-helloworld
- cd python-helloworld

# main program to invoke via torchrun (optional)
mainProgram: helloworld.py
Loading