GithubHelp home page GithubHelp logo

Better GPU support about training-operator HOT 4 CLOSED

jlewi avatar jlewi commented on May 18, 2024
Better GPU support

from training-operator.

Comments (4)

jlewi avatar jlewi commented on May 18, 2024 1

Hi

So I think it would be the responsibility of the "ops" person who deploys the TfJob operator to specify the location of the drivers on the host machine and appropriate mount points in the cluster.

This assumes that all GPU nodes in the cluster use the same driver version and have the drivers installed in the same location.

Supporting more multiple driver versions really depends on whether K8s eventually supports this.

For the TfJob operator the goal is really to just cut down on some of the boilerplate when specifying GPU jobs.

So with the current operator you can write a TfJob spec to use GPUs like so

- apiVersion: mlkube.io/v1beta1
  kind: TfJob
  spec:
    replica_specs:
    - replicas: 1
      template:
        metadata:
          creationTimestamp: null
        spec:
          containers:
          - args:
            - --gpu
            env:
            - name: LD_LIBRARY_PATH
              value: /usr/local/cuda/lib64
            image: gcr.io/project/tf_smoke_cmle-375-20:latest
            name: tensorflow
            resources: {}
            securityContext:
              privileged: true
            volumeMounts:
            - mountPath: /dev/nvidia0
              name: dev-nvidia
            - mountPath: /dev/nvidiactl
              name: dev-nvidiactl
            - mountPath: /dev/nvidia-uvm
              name: dev-nvidia-uvm
          restartPolicy: OnFailure
          volumes:
          - hostPath:
              path: /dev/nvidia0
            name: dev-nvidia
          - hostPath:
              path: /dev/nvidiactl
            name: dev-nvidiactl
          - hostPath:
              path: /dev/nvidia-uvm
            name: dev-nvidia-uvm
      tf_port: 2222
      tf_replica_type: MASTER

Since the mount paths would be the same for all TfJobs there's no reason to make the user specify it when creating individual jobs. The user could just specify the following.

- apiVersion: mlkube.io/v1beta1
  kind: TfJob
  spec:
    replica_specs:
    - replicas: 1
      template:
        metadata:
          creationTimestamp: null
        spec:
          containers:
          - args:
            - --gpu
      tf_port: 2222
      tf_replica_type: MASTER
      Gpus: 
          - type: nvidia-tesla-k80
            count: 1

The TfJob operator would be instantiated with the information it needs to add to the actual JobController specs to use GPUs. This would include adding the volume mounts showed above and scheduling constraints so it gets scheduled on GPU nodes.

from training-operator.

wbuchwalter avatar wbuchwalter commented on May 18, 2024

Hey!
If the user is not responsible to mount the drivers, what's your vision to deal with different driver versions, and different install locations?

from training-operator.

jlewi avatar jlewi commented on May 18, 2024

PR #9 is out for review.

Its pretty close to what I suggested above. Main difference is we look at container resources and limits to determine if GPUs are required rather than introducing new fields to indicate when GPUs are desired.

from training-operator.

jlewi avatar jlewi commented on May 18, 2024

PR #9 is merged.

from training-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.