Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a cpp extension #380

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

iclementine
Copy link
Collaborator

@iclementine iclementine commented Dec 30, 2024

PR Category

Other

Type of Change

Other

Description

Add a cpp extension(flag_gems._C) to flag_gems.

It finds torch include dirs & libraries and also cuda include dirs & libraries(if necessary).

Issue

Progress

  • Change is properly reviewed (1 reviewer required, 2 recommended).
  • Change is responded to an issue.
  • Change is fully covered by a UT.

Performance

setup.py Outdated
if debug_mode:
print("Compiling in debug mode")

use_cuda = use_cuda and torch.cuda.is_available() and CUDA_HOME is not None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expect using torch_device_fn.is_available() instead of torch.cuda.is_available()
and torch_device_fn from(from ..runtime import torch_device_fn)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is a part of flag_gems, it may not use the utilities provided by flag_gems. So I removed cuda extensions since it is planned to use c++-only extensions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants