Commit b15ef77
Added GGUF format support for LoRA adapters (openvinotoolkit#3204)
## Description
This PR implements support for LoRA adapters in GGUF format, extending
the existing safetensors-only support as mentioned in the project
roadmap.
## Changes
- Added `GGUFAdapterImpl` class to handle GGUF adapter loading
- Implemented `convert_gguf_name_to_hf()` function to map GGUF tensor
naming conventions to HuggingFace/OpenVINO conventions
- Modified `Adapter` constructor to detect `.gguf` extension and route
to appropriate implementation
- Added `ENABLE_GGUF` preprocessor guards for conditional compilation
## Implementation Details
The implementation:
- Reuses existing `get_gguf_data()` utilities from the GGUF
infrastructure
- Follows the same design pattern as `SafetensorsAdapterImpl` for
consistency
- Supports standard GGUF tensor naming conventions (`blk.N.`, `attn_q`,
`ffn_gate`, etc.)
- Automatically maps GGUF names to HuggingFace/OpenVINO conventions
## Testing
**Test Setup:**
- Model: TinyLlama-1.1B-Chat-v1.0 (OpenVINO format)
- Adapter: tinyllama-function-call-lora-adapter-250424-f16.gguf
**Results:**
Adapter object created successfully
Pipeline initialized with GGUF adapter
Text generation completed successfully
Output quality verified
## Related
Implemented support of GGUF LoRA
Closes openvinotoolkit#2323
cc @rkazants
---------
Co-authored-by: goyal <goyaladitya070@gmail.com>1 parent d207d0b commit b15ef77
File tree
2 files changed
+506
-2
lines changed- src/cpp/src/lora
- tests/python_tests
2 files changed
+506
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
1063 | 1071 | | |
1064 | 1072 | | |
1065 | 1073 | | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1066 | 1183 | | |
1067 | 1184 | | |
1068 | 1185 | | |
| |||
1122 | 1239 | | |
1123 | 1240 | | |
1124 | 1241 | | |
1125 | | - | |
1126 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1127 | 1252 | | |
1128 | 1253 | | |
1129 | 1254 | | |
| |||
0 commit comments