Commit 1303957
authored
VLM: wire performance instrumentation and logits output (apple#72)
* VLM: wire performance instrumentation and logits output
- Report prompt throughput (prefill t/s) and generation throughput
for VLM inference, matching the LLM path performance summary
- Wire --print-logits for VLM: shows top-5 token probabilities per step
- Wire --save-logits for VLM: saves top-K logits to JSON file
- Make TokenLogits and TopLogitEntry properties public (needed by runner)
Tested with LLaVA-1.5-7B bundle: prompt 590 tokens at 579 t/s,
generation 20 tokens at 19.4 t/s. Logits JSON output verified.
* VLM: wire performance instrumentation and logits output
- Report prompt throughput (prefill t/s) and generation throughput
for VLM inference, matching the LLM path performance summary
- Wire --print-logits for VLM: shows top-5 token probabilities per step
- Wire --save-logits for VLM: saves top-K logits to JSON via LogitsWriter
- Make TokenLogits and TopLogitEntry properties public (cross-module access)
Tested with VLM bundle: prompt 590 tokens at 579 t/s,
generation 20 tokens at 19.4 t/s. Logits JSON output verified.1 parent 78413ae commit 1303957
2 files changed
Lines changed: 62 additions & 7 deletions
File tree
- swift/Sources
- CoreAILanguageModels/Output
- Tools/llm-runner
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
886 | 889 | | |
887 | 890 | | |
888 | 891 | | |
| 892 | + | |
| 893 | + | |
889 | 894 | | |
890 | 895 | | |
891 | 896 | | |
892 | 897 | | |
893 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
894 | 902 | | |
895 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
896 | 912 | | |
| 913 | + | |
897 | 914 | | |
898 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
899 | 922 | | |
900 | 923 | | |
901 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
902 | 943 | | |
903 | 944 | | |
904 | 945 | | |
905 | 946 | | |
906 | 947 | | |
907 | 948 | | |
| 949 | + | |
| 950 | + | |
908 | 951 | | |
909 | 952 | | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
910 | 959 | | |
911 | 960 | | |
912 | 961 | | |
| |||
0 commit comments