Performance Optimization for Inkling2m on llama.cpp

Developers have identified a significant performance bottleneck in the implementation of the Inkling2m model within the llama.cpp framework, specifically regarding the use of DFlash2. According to reports circulating on Reddit, a recent patch has been proposed to address inefficiencies in how the software handles looping transformers within its drafters.

Technical Findings and Benchmarks

The issue was identified following the merger of llama.cpp version 1.1.0, which introduced full support for the Inkling 2 Mini model. Users reported that the DFlash2 implementation was performing significantly below expected levels. Debugging efforts revealed that the software was not optimally supporting looping transformers in its drafter components.

A developer has submitted a pull request to the llama.cpp repository, building upon a fix originally identified in a fork by user renoirvieir4. Preliminary testing shared by the developer suggests that the patched version of the master branch provides a substantial increase in throughput.

According to unverified benchmark data provided by the developer, the performance improvements are as follows:

  • Code Generation (tokens per second): Increased from 51.0 tok/s in the official build (b12726) to 158.0 tok/s in the patched master.
  • Prose Generation (tokens per second): Increased from 51.2 tok/s in the official build to 85.7 tok/s in the patched master.

Community Response and Hardware Observations

The proposed fix is currently undergoing review by experts on GitHub. While the performance gains for Inkling2m are notable, community members have reported varying results across different hardware configurations.

On Reddit, one user reported achieving over 120 tokens per second for decoding on a 5060 Ti 16GB GPU. Conversely, another user reported seeing 17 tokens per second on a 5080 when running the Basalt model. Discussions among users also touched upon the comparative performance of DFlash2 versus DSpark, with some noting that DFlash2 can yield superior results depending on the specific use case.

The patch is expected to be merged into the main llama.cpp codebase following the completion of the current review process.