Skip to content

ggml : support truncate=false for YaRN - #30206

Open
tokinasin wants to merge 5 commits into
ggml-org:masterfrom
tokinasin:fix/cpu-yarn-no-truncate-pr1
Open

tokinasin wants to merge 5 commits into
ggml-org:masterfrom
tokinasin:fix/cpu-yarn-no-truncate-pr1

Conversation

@tokinasin

@tokinasin tokinasin commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Only CPU and CUDA are currently supported, changes to other backends are to mark as unsupported.

YaRN calculates correction intervals to switch frequency interpolation methods, but the setting to not round the boundaries of these intervals to integers (truncate=false) was not supported.

Models that use truncate=false include gpt-oss and some PLaMo-3 models; to support those models correctly, the GGML operations and CPU/CUDA backends are modified to handle calculations without rounding. The default behavior is truncate=true, and existing calls not explicitly configured will maintain their previous behavior.

Additional information

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES
    • I used Codex for research, code generation and reviews, etc.

@tokinasin
tokinasin requested review from a team, ggerganov, marty1885 and wine99 as code owners October 9, 2026 06:22
@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language Apple Metal https://en.wikipedia.org/wiki/Metal_(API) Ascend NPU issues specific to Ascend NPUs OpenCL Issues specific to the OpenCL backend Hexagon CUDA Related to the CUDA backend OpenVINO WebGPU labels Oct 9, 2026
@CISC

CISC commented Oct 9, 2026

Copy link
Copy Markdown
Member

Generally seems ok, @ggerganov would have to weight in on the implementation.

I assume there will be follow ups for at least one backend with test and conversion/loading?

@tokinasin

Copy link
Copy Markdown
Contributor Author

Added CUDA backend support and tests.
I plan to handle the conversion/loading fixes in a separate PR.

@ggerganov ggerganov self-assigned this Oct 9, 2026
@github-actions github-actions Bot added the testing Everything test related label Oct 9, 2026
Comment thread ggml/include/ggml.h Outdated
Comment thread ggml/include/ggml.h Outdated
@ggerganov ggerganov mentioned this pull request Oct 15, 2026
1 task
@tokinasin
tokinasin requested a review from ggerganov October 16, 2026 11:48
Comment thread ggml/src/ggml-metal/ggml-metal-device.m
Comment thread ggml/include/ggml.h
@tokinasin
tokinasin force-pushed the fix/cpu-yarn-no-truncate-pr1 branch from b2460bb to 82d7f48 Compare October 18, 2026 06:08
@tokinasin

Copy link
Copy Markdown
Contributor Author

Rebased since the Metal test-fusion CI failure appears to have been fixed in #30618.

@tokinasin

Copy link
Copy Markdown
Contributor Author

@ggerganov

Thanks for the reviews so far!

Since I'm limited to having two PRs open at a time, I'd appreciate it if you could take another look at this PR when you have a chance.

Please let me know if there's anything else I need to address.

@tokinasin
tokinasin force-pushed the fix/cpu-yarn-no-truncate-pr1 branch from 82d7f48 to c79bb16 Compare October 23, 2026 01:36
@CISC

CISC commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Bad merge. Nvm, rebase please. :)

YaRN calculates correction intervals to switch frequency interpolation
methods, but the setting to not round the boundaries of these intervals
to integers (`truncate=false`) was not supported.

Models that use `truncate=false` include gpt-oss and some PLaMo-3
models; to support them correctly, the GGML operations and CPU backend
are modified to handle calculations without rounding. The default
behavior is `truncate=true`, and existing calls not explicitly
configured will maintain their previous behavior.
@tokinasin
tokinasin force-pushed the fix/cpu-yarn-no-truncate-pr1 branch from c79bb16 to 79ece22 Compare October 23, 2026 07:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) Ascend NPU issues specific to Ascend NPUs CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning Hexagon OpenCL Issues specific to the OpenCL backend OpenVINO SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language testing Everything test related Vulkan Issues specific to the Vulkan backend WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants