Skip to content

Commit

Permalink
[fbgemm_gpu] Deprecate Python 3.8 builds
Browse files Browse the repository at this point in the history
- Deprecate Python 3.8 builds as Python 3.8 has been deprecated from PyTorch builds since 2024-07-31

- Clarify module load errors in OSS
  • Loading branch information
q10 committed Aug 15, 2024
1 parent 7105d5f commit 0df17c3
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/fbgemm_gpu_install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ __install_check_subpackages () {

echo "[INSTALL] Check for installation of Python sources ..."
local subpackages=(
"fbgemm_gpu.config"
"fbgemm_gpu.docs"
"fbgemm_gpu.quantize"
"fbgemm_gpu.tbe.cache"
)

Expand Down
1 change: 0 additions & 1 deletion .github/scripts/fbgemm_gpu_test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ test_fbgemm_gpu_setup_and_pip_install () {
}

local python_versions=(
3.8
3.9
3.10
3.11
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_ci_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
{ arch: x86, instance: "linux.4xlarge" },
{ arch: arm, instance: "linux.arm64.2xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
compiler: [ "gcc", "clang" ]

steps:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
{ arch: x86, instance: "linux.4xlarge", timeout: 20 },
{ arch: arm, instance: "linux.arm64.2xlarge", timeout: 30 },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
compiler: [ "gcc", "clang" ]
needs: build_artifact

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_ci_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.24xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
compiler: [ "gcc", "clang" ]

Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
# https://hud.pytorch.org/metrics
# { arch: x86, instance: "linux.gcp.a100" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
# Specify exactly ONE CUDA version for artifact publish
cuda-version-publish: [ "12.1.1" ]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_ci_genai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.24xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
compiler: [ "gcc", "clang" ]

Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
# https://hud.pytorch.org/metrics
# { arch: x86, instance: "linux.gcp.a100" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
# Specify exactly ONE CUDA version for artifact publish
cuda-version-publish: [ "12.1.1" ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fbgemm_gpu_ci_rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
{ arch: x86, instance: "linux.24xlarge" },
]
container-image: [ "ubuntu:20.04" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
rocm-version: [ "6.0.2" ]
compiler: [ "gcc", "clang" ]

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/fbgemm_gpu_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
name: FBGEMM_GPU PIP Install + Test

on:
# PR Trigger (enabled for regression checks and debugging)
#
pull_request:
branches:
- main

# Cron Trigger (UTC)
#
# Based on the the nightly releases schedule in PyTorch infrastructure, the
Expand Down Expand Up @@ -64,7 +70,7 @@ jobs:
{ arch: x86, instance: "linux.4xlarge", timeout: 20 },
{ arch: arm, instance: "linux.arm64.2xlarge", timeout: 30 },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- name: Setup Build Container
Expand Down Expand Up @@ -120,7 +126,7 @@ jobs:
host-machine: [
{ instance: "linux.g5.4xlarge.nvidia.gpu" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_release_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
{ arch: x86, instance: "linux.4xlarge" },
{ arch: arm, instance: "linux.arm64.2xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- name: Setup Build Container
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
{ arch: x86, instance: "linux.4xlarge", timeout: 20 },
{ arch: arm, instance: "linux.arm64.2xlarge", timeout: 30 },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
needs: build_artifact

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_release_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.24xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]

steps:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.g5.4xlarge.nvidia.gpu" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
needs: build_artifact

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fbgemm_gpu_release_genai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.24xlarge" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]

steps:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
host-machine: [
{ arch: x86, instance: "linux.g5.4xlarge.nvidia.gpu" },
]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
cuda-version: [ "11.8.0", "12.1.1", "12.4.1" ]
needs: build_artifact

Expand Down
25 changes: 12 additions & 13 deletions fbgemm_gpu/fbgemm_gpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import logging
import os

import torch

try:
torch.ops.load_library(os.path.join(os.path.dirname(__file__), "fbgemm_gpu_py.so"))
except Exception as error_ranking:
def _load_library(filename: str) -> None:

Check failure on line 13 in fbgemm_gpu/fbgemm_gpu/__init__.py

View workflow job for this annotation

GitHub Actions / run-lint (3.11)

E302 expected 2 blank lines, found 1
"""Load a shared library from the given filename."""
try:
torch.ops.load_library(
os.path.join(
os.path.dirname(__file__),
"experimental/gen_ai/fbgemm_gpu_experimental_gen_ai_py.so",
)
)
except Exception as error_gen_ai:
# When both ranking/gen_ai so files are not available, print the error logs
print(error_ranking)
print(error_gen_ai)
torch.ops.load_library(os.path.join(os.path.dirname(__file__), filename))
except Exception as error:
logging.warning(f"Could not the library '{filename}': {error}. This may be expected depending on the FBGEMM_GPU variant.")

for filename in [

Check failure on line 20 in fbgemm_gpu/fbgemm_gpu/__init__.py

View workflow job for this annotation

GitHub Actions / run-lint (3.11)

E305 expected 2 blank lines after class or function definition, found 1
"fbgemm_gpu_py.so",
"experimental/gen_ai/fbgemm_gpu_experimental_gen_ai_py.so",
]:
_load_library(filename)

# Since __init__.py is only used in OSS context, we define `open_source` here
# and use its existence to determine whether or not we are in OSS context
Expand Down
2 changes: 1 addition & 1 deletion fbgemm_gpu/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def main(argv: List[str]) -> None:
]
+ [
f"Programming Language :: Python :: {x}"
for x in ["3", "3.8", "3.9", "3.10", "3.11", "3.12"]
for x in ["3", "3.9", "3.10", "3.11", "3.12"]
],
)

Expand Down

0 comments on commit 0df17c3

Please sign in to comment.