Skip to content

Question of behavior of storing custom configuration of autotune function #90

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

Closed
SangbumChoi opened this issue Nov 30, 2023 · 3 comments

Comments

@SangbumChoi
Copy link

SangbumChoi commented Nov 30, 2023

As I mentioned in the question I understand the function of

def _autotune(configs, function):

However, rather than using A100 GPU instances

def _load_best_configs():

it was intended to use saved_config.

instead of


shouldn't be

    if not device_name.startswith('NVIDIA A100'):
        cwd = pathlib.Path.cwd()
        saved_configs = cwd / "flash_4_configs.p"
        print(f"We will try to read previously created kernel configurations from {saved_configs}.")
        print("You can disable this kernel by setting SEGMENT_ANYTHING_FAST_USE_FLASH_4=0")
    if saved_configs.is_file():
        import pickle
        with open(saved_configs, 'rb') as f:
            print(f"Loading best configs from file {saved_configs}")
            return pickle.load(f)
    return None
@cpuhrsch
Copy link
Contributor

cpuhrsch commented Dec 1, 2023

Hello @SangbumChoi,

Yes, this should store the config to the current directory if you're not using an A100. And yes, you're right, we should probably delete https://github.com/pytorch-labs/segment-anything-fast/blob/main/segment_anything_fast/flash_4.py#L237 ... I'll fix this asap! Does it work for you if you remove this line?

Thank you!

@SangbumChoi
Copy link
Author

Removing this line and add it into end of the function works for me!

@cpuhrsch
Copy link
Contributor

cpuhrsch commented Dec 8, 2023

Removed it in #100 . Sorry for the delay. Hope this resolves your issue. Will also review your PR #89 . Please let me know if this doesn't work.

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

No branches or pull requests

2 participants