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

Add AWS Inf2 instances support for aws_batch scheduler #977

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shixianc
Copy link

Add AWS Inf2 instances support for aws_batch scheduler. There're usecases to use torchx to launch data parallel inference jobs on inf2 instances on AWS Batch.

Configurations are referencing https://aws.amazon.com/ec2/instance-types/inf2/

Test plan:
Updated unittest to cover new changes.

671 passed, 98 warnings in 177.52s (0:02:57)
❯ torchx run -s local_docker --dryrun dist.ddp -h aws_inf2.48xlarge -j 1 --m abc

=== SCHEDULER REQUEST ===

  • !!python/object:torchx.schedulers.docker_scheduler.DockerContainer
    command:
    • bash
    • -c
    • torchrun --rdzv_backend c10d --rdzv_endpoint localhost:0 --rdzv_id 'abc-kr12qr37093rz'
      --nnodes 1 --nproc_per_node 1 --tee 3 --role '' -m abc
      image: sha256:3f8f845e25030d9523bf299dee1c3ca6f2b008fc2bf0a2161ed949efe168a3e1
      kwargs:
      devices:
      • /dev/neuron0:/dev/neuron0:rwm
      • /dev/neuron1:/dev/neuron1:rwm
      • /dev/neuron2:/dev/neuron2:rwm
      • /dev/neuron3:/dev/neuron3:rwm
      • /dev/neuron4:/dev/neuron4:rwm
      • /dev/neuron5:/dev/neuron5:rwm
      • /dev/neuron6:/dev/neuron6:rwm
      • /dev/neuron7:/dev/neuron7:rwm
      • /dev/neuron8:/dev/neuron8:rwm
      • /dev/neuron9:/dev/neuron9:rwm
      • /dev/neuron10:/dev/neuron10:rwm
      • /dev/neuron11:/dev/neuron11:rwm
        environment:
        LOGLEVEL: WARNING
        TORCHX_JOB_ID: local_docker://torchx/abc-kr12qr37093rz
        TORCHX_RANK0_HOST: abc-kr12qr37093rz-abc-0
        TORCHX_TRACKING_EXPERIMENT_NAME: default-experiment
        hostname: abc-kr12qr37093rz-abc-0
        labels:
        torchx.pytorch.org/app-id: abc-kr12qr37093rz
        torchx.pytorch.org/replica-id: '0'
        torchx.pytorch.org/role-name: abc
        torchx.pytorch.org/version: 0.8.0dev0
        mem_limit: 377472m
        mounts: []
        name: abc-kr12qr37093rz-abc-0
        nano_cpus: 192000000000
        network: torchx
        privileged: false
        shm_size: 377472m

@facebook-github-bot
Copy link
Contributor

Hi @shixianc!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@shixianc
Copy link
Author

@d4l3k, @kiukchung could you help review? thanks!

Copy link
Member

@d4l3k d4l3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- can you sign the CLA?

@shixianc
Copy link
Author

LGTM -- can you sign the CLA?

Signed a few mins ago, probably take some time to propagate.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 25, 2024
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@shixianc
Copy link
Author

Hi @d4l3k
Could you help check on the lint failure? I ran locally lintrunner --skip PYRE --force-color --all-files
and returns ok No lint issues.
Is this something I need to further look into from my end?

@kiukchung
Copy link
Collaborator

@shixianc can you rebase onto main? 53933e3 updates pyre version.

@shixianc
Copy link
Author

shixianc commented Nov 26, 2024

@kiukchung @d4l3k rebased. Could you help rerun the checks?

return Resource(
cpu=4,
gpu=0,
memMB=32 * GiB,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16GB of memory not 32? Pretty sure this refers to the CPU memory not the accelerator memory

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashvinnihalani Good catch, thanks for pointing this out.

I was referencing trn1 and thought the field is for GPU memory, but then realize trn1 has same GPU and CPU memory.

return Resource(
cpu=32,
gpu=0,
memMB=32 * GiB,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

128 GB of RAM

return Resource(
cpu=96,
gpu=0,
memMB=192 * GiB,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

384 GB of RAM

)


def aws_inf2_48xlarge() -> Resource:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

768 GB of RAM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants