Skip to content

Commit

Permalink
[misc] op_builder/builder.py (hpcaitech#3593)
Browse files Browse the repository at this point in the history
Optimization Code
The source code has not been modified, only a few spelling errors in the comments have been changed
  • Loading branch information
digger-yu authored Apr 18, 2023
1 parent 5a79cff commit d96567b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions op_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def sources_files(self) -> List[str]:
@abstractmethod
def include_dirs(self) -> List[str]:
"""
This function should return a list of inlcude files for extensions.
This function should return a list of include files for extensions.
"""
pass

Expand Down Expand Up @@ -127,13 +127,13 @@ def check_runtime_build_environment(self):

if CUDA_HOME is None:
raise RuntimeError(
"CUDA_HOME is not found. You need to export CUDA_HOME environment vairable or install CUDA Toolkit first in order to build CUDA extensions"
"CUDA_HOME is not found. You need to export CUDA_HOME environment variable or install CUDA Toolkit first in order to build CUDA extensions"
)

# make sure CUDA is available for compilation during
cuda_available = check_cuda_availability()
if not cuda_available:
raise RuntimeError("CUDA is not available on your system as torch.cuda.is_avaible() returns False.")
raise RuntimeError("CUDA is not available on your system as torch.cuda.is_available() returns False.")

# make sure system CUDA and pytorch CUDA match, an error will raised inside the function if not
check_system_pytorch_cuda_match(CUDA_HOME)
Expand Down Expand Up @@ -161,7 +161,7 @@ def load(self, verbose: Optional[bool] = None):
op_module = self.import_op()
if verbose:
print_rank_0(
f"[extension] OP {self.prebuilt_import_path} has been compileed ahead of time, skip building.")
f"[extension] OP {self.prebuilt_import_path} has been compiled ahead of time, skip building.")
except ImportError:
# check environment
self.check_runtime_build_environment()
Expand Down

0 comments on commit d96567b

Please sign in to comment.