Skip to content

Drop two no-op cpu() calls in the k-means cuda path - #2835

Open
darkdi wants to merge 1 commit into
apple:mainfrom
darkdi:kmeans-drop-noop-cpu-calls
Open

Drop two no-op cpu() calls in the k-means cuda path#2835
darkdi wants to merge 1 commit into
apple:mainfrom
darkdi:kmeans-drop-noop-cpu-calls

Conversation

@darkdi

@darkdi darkdi commented Aug 25, 2026

Copy link
Copy Markdown

Noticed this in the cuda branch of _cluster_weights_2d. Tensor.cpu() is not in place, so both calls build a copy and drop it while the originals stay on the device, and the assignment ten lines up shows the form that was meant. If freeing device memory before the return was the point, layerwise_compressor does it with del plus empty_cache, so you may want that here instead.

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.

1 participant