Skip to content

Commit

Permalink
only add deps if extra is explictly called (#2432)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffra authored Oct 18, 2022
1 parent 799120e commit 1b7c679
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions op_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,18 +407,6 @@ def simd_width(self):
return '-D__AVX256__'
return '-D__SCALAR__'

def python_requirements(self):
'''
Override if op wants to define special dependencies, otherwise will
take self.name and load requirements-<op-name>.txt if it exists.
'''
path = f'requirements/requirements-{self.name}.txt'
requirements = []
if os.path.isfile(path):
with open(path, 'r') as fd:
requirements = [r.strip() for r in fd.readlines()]
return requirements

def command_exists(self, cmd):
if '|' in cmd:
cmds = cmd.split("|")
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def fetch_requirements(path):
'autotuning': fetch_requirements('requirements/requirements-autotuning.txt'),
'autotuning_ml': fetch_requirements('requirements/requirements-autotuning-ml.txt'),
'sparse_attn': fetch_requirements('requirements/requirements-sparse_attn.txt'),
'inf': fetch_requirements('requirements/requirements-inf.txt')
'inf': fetch_requirements('requirements/requirements-inf.txt'),
'sd': fetch_requirements('requirements/requirements-sd.txt')
}

# Add specific cupy version to both onebit extension variants
Expand Down Expand Up @@ -150,11 +151,6 @@ def op_enabled(op_name):
builder.warning(f"One can disable {op_name} with {env_var}=0")
abort(f"Unable to pre-compile {op_name}")

# If op is compatible update install reqs so it can potentially build/run later
if op_compatible:
reqs = builder.python_requirements()
install_requires += builder.python_requirements()

# if op is compatible but install is not enabled (JIT mode)
if is_rocm_pytorch and op_compatible and not op_enabled(op_name):
builder.hipify_extension()
Expand Down

0 comments on commit 1b7c679

Please sign in to comment.