GPULlama3.java icon indicating copy to clipboard operation
GPULlama3.java copied to clipboard

Refactor and Restructure

Open orionpapadakis opened this issue 8 months ago • 1 comments

Refactor and Restructure loader.weights and core Packages

Summary

To improve project maintainability and readability, a refactor of two key packages: loader.weights and core is proposed. More specifically:


1. Move loader.weights into the model package

The current separation introduces unnecessary indirection. Consolidating these classes under model better reflects their role and simplifies the structure.

Proposed Changes:

  • Move loader.weights.ModelLoadermodel.loader.ModelLoader
  • Move loader.weights.Statemodel.State,
  • Move loader.weights.Weightsmodel.Weights

2. Full Refactor of the core Package

The core package currently combines low-level data structures. The naming is vague and could be improved for better clarity and cohesion.

Proposed Actions:

  • Rename the core package to something more descriptive:
    • Suggested options: data, types, or tensors
  • Restructure sub-packages and files accordingly:
    • model.tensor.* classes like FloatTensor, F16FloatTensor, etc. → data.tensor or types.tensor
    • GGUF, GGMLType → potentially under data.format or a similar grouping
    • Float16 → into data or types package
    • Pair → move to auxiliary package

Open Questions

  • Should we adopt data, types, or another name for the renamed core package?
  • Are there any objections to merging loader.weights into the model package?

orionpapadakis avatar Jun 13 '25 10:06 orionpapadakis

Sounds good, lets do this after we merge #17 before adding support for #19

mikepapadim avatar Jun 13 '25 10:06 mikepapadim