From 2c4e3cb0d8c4245898eaff130a895c42137b8f34 Mon Sep 17 00:00:00 2001 From: Renfei Chen Date: Wed, 19 Jan 2022 21:13:07 -0800 Subject: [PATCH 1/3] Add scale-config to enable using gpu workers Summary: title, used less than half the max_available of pytorch org: https://fburl.com/code/2hiwiwwu Differential Revision: D33672151 fbshipit-source-id: dcdf963653c286e77ccceb1720145dd971f0963b --- .github/workflows/scale-config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/scale-config.yml diff --git a/.github/workflows/scale-config.yml b/.github/workflows/scale-config.yml new file mode 100644 index 000000000..6c9c1009d --- /dev/null +++ b/.github/workflows/scale-config.yml @@ -0,0 +1,11 @@ +runner_types: + linux.2xlarge: + instance_type: c5.2xlarge + os: linux + max_available: 200 + disk_size: 150 + linux.8xlarge.nvidia.gpu: + instance_type: p3.8xlarge + os: linux + max_available: 10 + disk_size: 150 From a72059b755c641886651707dabee73db89d6ac0d Mon Sep 17 00:00:00 2001 From: Renfei Chen Date: Wed, 19 Jan 2022 21:13:07 -0800 Subject: [PATCH 2/3] Move scale-config to the right location Summary: title Differential Revision: D33676760 fbshipit-source-id: c24ac358cbdd569106fa5191d79df749f12b08df --- .github/workflows/scale-config.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/workflows/scale-config.yml diff --git a/.github/workflows/scale-config.yml b/.github/workflows/scale-config.yml deleted file mode 100644 index 6c9c1009d..000000000 --- a/.github/workflows/scale-config.yml +++ /dev/null @@ -1,11 +0,0 @@ -runner_types: - linux.2xlarge: - instance_type: c5.2xlarge - os: linux - max_available: 200 - disk_size: 150 - linux.8xlarge.nvidia.gpu: - instance_type: p3.8xlarge - os: linux - max_available: 10 - disk_size: 150 From 363cc29a6d4daeb2c56bbe19c372db049926d9c7 Mon Sep 17 00:00:00 2001 From: Renfei Chen Date: Wed, 19 Jan 2022 21:13:21 -0800 Subject: [PATCH 3/3] test Differential Revision: D33677315 fbshipit-source-id: 91c48089bb27b38cf31ae5eb4f5e09ffa3740c69 --- .github/workflows/test_build_on_cpu_gpu.yml | 57 +++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test_build_on_cpu_gpu.yml diff --git a/.github/workflows/test_build_on_cpu_gpu.yml b/.github/workflows/test_build_on_cpu_gpu.yml new file mode 100644 index 000000000..161b9e9d0 --- /dev/null +++ b/.github/workflows/test_build_on_cpu_gpu.yml @@ -0,0 +1,57 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: [push] + +jobs: + build_cpu: + runs-on: linux.2xlarge + + steps: + + - name: check cpu info + shell: bash + run: | + cat /proc/cpuinfo + + - name: Display EC2 information + shell: bash + run: | + set -euo pipefail + function get_ec2_metadata() { + # Pulled from instance metadata endpoint for EC2 + # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html + category=$1 + curl -fsSL "http://169.254.169.254/latest/meta-data/${category}" + } + echo "ami-id: $(get_ec2_metadata ami-id)" + echo "instance-id: $(get_ec2_metadata instance-id)" + echo "instance-type: $(get_ec2_metadata instance-type)" + + build_gpu: + runs-on: linux.8xlarge.nvidia.gpu + steps: + - name: check cpu info + shell: bash + run: | + cat /proc/cpuinfo + + - name: check cpu info + shell: bash + run: | + sudo lshw -C display + - name: Display EC2 information + shell: bash + run: | + set -euo pipefail + function get_ec2_metadata() { + # Pulled from instance metadata endpoint for EC2 + # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html + category=$1 + curl -fsSL "http://169.254.169.254/latest/meta-data/${category}" + } + echo "ami-id: $(get_ec2_metadata ami-id)" + echo "instance-id: $(get_ec2_metadata instance-id)" + echo "instance-type: $(get_ec2_metadata instance-type)"