Repository navigation
Conversation
|
This looks great! Removing 700 lines of duplicated code would be very good. |
|
Need second eyes to check if I do it correctly as this is compute graph change. I am not an expert in AI algorithms. There is potentially more code to be removed. |
Absolutely! Wanted to leave the code-deduplication refactoring for later, after the most important features and optimizations are implemented. The llama file loader changes should probably go into a separate pull request as they seem to be unrelated to the training. I will look into the training related changed of this PR this week. |
|
@howard0su I think we already merged the model loading changes. Maybe recreate the PR for clarity |
|
Sorry, I messed the commits. regen from latest master. |
|
I think this pull request is now obsolete, because all the here refactored functions are already removed in favor of one unified function to build the train graph: |
…ked-layout registrations (engine ggml-org#1997) (#287) Several HRX MUL_MAT registrations read the weight in a packed layout that is only materialised for a tensor in a buffer flagged as weights. test_mul_mat keeps its weight in the ordinary buffer, so any case that reached one of them was refused at execution and the suite compared the never-written output (an "ERR" of k/3 + 1): those kernels had no known-answer case at all. test_mul_mat_resident_weight puts the weight in the weight context, as a model's is, with one case per registration: the Q4_K packed prefill, the Q6_K prefill, the Q6_K i8 prepacked and aligned-skinny forms, the Q6_K one-token final projection, and the Q5_K prefill (native layout) as the control. Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
…ison, not scored (engine ggml-org#1997) (#290) ggml_backend_compare_graph_backend ignored the status of both computes. A backend that refuses or fails a graph leaves its outputs unwritten, and the callback then compared those against the other backend: an HRX program refused for an unflagged weight came out of test-backend-ops as "ERR = 1358" - k/3 + 1 against the output tensor's random fill - which reads like a kernel fault. The helper now says which backend failed, with its status, compares nothing, and returns false. Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
Consolidate the duplicate functions into one to have operations:
Baby step towards adding training APIs to llama.h.