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

specifying a custom device crashes the merge #3

Open
Pyr-000 opened this issue Nov 19, 2022 · 1 comment · May be fixed by #4
Open

specifying a custom device crashes the merge #3

Pyr-000 opened this issue Nov 19, 2022 · 1 comment · May be fixed by #4

Comments

@Pyr-000
Copy link

Pyr-000 commented Nov 19, 2022

Specifying a device (e.g. .\.venv\Scripts\python.exe .\SD_rebasin_merge.py --model_a .\standard_models\mix_in_1 --model_b .\standard_models\mix_in_2 --output .\standard_models\mixed --device cuda ) crashes the script:

Traceback (most recent call last):
  File ".\SD_rebasin_merge.py", line 23, in <module>
    final_permutation = weight_matching(permutation_spec, state_a, state_b)
  File ".\weight_matching.py", line 796, in weight_matching
    w_b = get_permuted_param(ps, perm, wk, params_b, except_axis=axis)
  File ".\weight_matching.py", line 773, in get_permuted_param
    w = torch.index_select(w, axis, perm[p].int())
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)
@Pyr-000 Pyr-000 linked a pull request Nov 19, 2022 that will close this issue
@Pyr-000
Copy link
Author

Pyr-000 commented Nov 19, 2022

I should note that I can't fully test this, as I am far from having enough VRAM to do the full merge on GPU. When running on CPU, it seems to peak at over 60GB of memory.

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 a pull request may close this issue.

1 participant