Skip to content

Commit

Permalink
resolve genai build fix: still print error info
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuh committed May 19, 2024
1 parent 6cb086a commit 6330970
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions fbgemm_gpu/fbgemm_gpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@

import torch


try:
torch.ops.load_library(os.path.join(os.path.dirname(__file__), "fbgemm_gpu_py.so"))
except Exception as e:
pass
# print(e)
except Exception as error_ranking:
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)

# 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 All @@ -30,4 +37,3 @@
from . import sparse_ops # noqa: F401, E402
except Exception as e:
pass
# print(e)
2 changes: 1 addition & 1 deletion fbgemm_gpu/fbgemm_gpu/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# Trigger the manual addition of docstrings to pybind11-generated operators
try:
from . import jagged_tensor_ops, table_batched_embedding_ops # noqa: F401
except Exception as e:
except Exception:
pass

0 comments on commit 6330970

Please sign in to comment.