Skip to content

Commit

Permalink
Merge branch 'master' into rearrange_ops
Browse files Browse the repository at this point in the history
  • Loading branch information
tjruwase authored Aug 31, 2024
2 parents c1eb49a + 9b7fc54 commit ddd0021
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/no-torch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: no-torch

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/no-torch.yml'
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
issues: write

jobs:
unit-tests:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- id: setup-venv
uses: ./.github/workflows/setup-venv

- name: Python environment
run: |
pip uninstall torch --yes
pip list
- name: Build deepspeed
run: |
DS_BUILD_STRING=" " python setup.py sdist
- name: Open GitHub issue if nightly CI fails
if: ${{ failure() && (github.event_name == 'schedule') }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/ci_failure_report.md
update_existing: true
2 changes: 1 addition & 1 deletion csrc/gds/py_lib/deepspeed_py_gds_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ deepspeed_gds_handle_t::deepspeed_gds_handle_t(const int block_size,
const bool single_submit,
const bool overlap_events,
const int num_threads)
: deepspeed_io_handle_t(block_size, queue_depth, single_submit, overlap_events, num_threads)
: deepspeed_io_handle_t(block_size, queue_depth, single_submit, overlap_events, 1)
{
_init_cuFile(block_size, queue_depth, num_threads);
}
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/comm/ccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def build_ccl_op():
builder = get_accelerator().create_op_builder("CCLCommBuilder")
if builder is None or NotImplementedBuilder:
if builder is None or isinstance(builder, NotImplementedBuilder):
return None
ccl_cpp_module = builder.load()
print(f'DeepSpeed {builder.absolute_name()} built successfully')
Expand Down
5 changes: 5 additions & 0 deletions op_builder/gds.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def extra_ldflags(self):
return super().extra_ldflags() + ['-lcufile']

def is_compatible(self, verbose=False):
if self.is_rocm_pytorch():
if verbose:
self.warning(f'{self.NAME} is not compatible with ROCM')
return False

try:
import torch.utils.cpp_extension
except ImportError:
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/inference/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ def verify_injection(module):
verify_injection(model)


# Used to Get Device name
def getDeviceId(local_rank):
device = torch.device(f"{get_accelerator().device_name(local_rank)}")
return device


# Verify that test is valid
def validate_test(model_w_task, dtype, enable_cuda_graph, enable_triton):
model, task = model_w_task
Expand Down Expand Up @@ -484,8 +490,8 @@ def test(
pytest.skip(f"Acceleraor {get_accelerator().device_name()} does not support {dtype}.")

local_rank = int(os.getenv("LOCAL_RANK", "0"))

pipe = pipeline(task, model=model, model_kwargs={"low_cpu_mem_usage": True}, device=local_rank, framework="pt")
device = getDeviceId(local_rank)
pipe = pipeline(task, model=model, model_kwargs={"low_cpu_mem_usage": True}, device=device, framework="pt")
bs_output = pipe(query, **inf_kwargs)
pipe.model = deepspeed.init_inference(pipe.model,
mp_size=self.world_size,
Expand Down

0 comments on commit ddd0021

Please sign in to comment.