SHARP on AX8860: models, binaries, Python binding, web demo
Browse files- LICENSE_MODEL +88 -0
- README.md +89 -0
- assets/ant.webp +3 -0
- bin/libsharp_ax.so +3 -0
- bin/sharp_ax +3 -0
- models/fp8vit/image.bank +3 -0
- models/fp8vit/image.idx +439 -0
- models/fp8vit/patch.bank +3 -0
- models/fp8vit/patch.idx +439 -0
- models/fp8vit/vit_embed.axmodel +3 -0
- models/fp8vit/vit_final_ln.axmodel +3 -0
- models/fp8vit/vit_layer.axmodel +3 -0
- models/h4_wb.bin +3 -0
- models/sharp_tail.axmodel +3 -0
- python/sharp_ax.py +105 -0
- python/web_demo.html +90 -0
- python/web_demo.py +162 -0
LICENSE_MODEL
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Disclaimer: IMPORTANT: This Apple Machine Learning Research Model is
|
| 2 |
+
specifically developed and released by Apple Inc. ("Apple") for the sole purpose
|
| 3 |
+
of scientific research of artificial intelligence and machine-learning
|
| 4 |
+
technology. “Apple Machine Learning Research Model” means the model, including
|
| 5 |
+
but not limited to algorithms, formulas, trained model weights, parameters,
|
| 6 |
+
configurations, checkpoints, and any related materials (including
|
| 7 |
+
documentation).
|
| 8 |
+
|
| 9 |
+
This Apple Machine Learning Research Model is provided to You by
|
| 10 |
+
Apple in consideration of your agreement to the following terms, and your use,
|
| 11 |
+
modification, creation of Model Derivatives, and or redistribution of the Apple
|
| 12 |
+
Machine Learning Research Model constitutes acceptance of this Agreement. If You
|
| 13 |
+
do not agree with these terms, please do not use, modify, create Model
|
| 14 |
+
Derivatives of, or distribute this Apple Machine Learning Research Model or
|
| 15 |
+
Model Derivatives.
|
| 16 |
+
|
| 17 |
+
* License Scope: In consideration of your agreement to abide by the following
|
| 18 |
+
terms, and subject to these terms, Apple hereby grants you a personal,
|
| 19 |
+
non-exclusive, worldwide, non-transferable, royalty-free, revocable, and
|
| 20 |
+
limited license, to use, copy, modify, distribute, and create Model
|
| 21 |
+
Derivatives (defined below) of the Apple Machine Learning Research Model
|
| 22 |
+
exclusively for Research Purposes. You agree that any Model Derivatives You
|
| 23 |
+
may create or that may be created for You will be limited to Research Purposes
|
| 24 |
+
as well. “Research Purposes” means non-commercial scientific research and
|
| 25 |
+
academic development activities, such as experimentation, analysis, testing
|
| 26 |
+
conducted by You with the sole intent to advance scientific knowledge and
|
| 27 |
+
research. “Research Purposes” does not include any commercial exploitation,
|
| 28 |
+
product development or use in any commercial product or service.
|
| 29 |
+
|
| 30 |
+
* Distribution of Apple Machine Learning Research Model and Model Derivatives:
|
| 31 |
+
If you choose to redistribute Apple Machine Learning Research Model or its
|
| 32 |
+
Model Derivatives, you must provide a copy of this Agreement to such third
|
| 33 |
+
party, and ensure that the following attribution notice be provided: “Apple
|
| 34 |
+
Machine Learning Research Model is licensed under the Apple Machine Learning
|
| 35 |
+
Research Model License Agreement.” Additionally, all Model Derivatives must
|
| 36 |
+
clearly be identified as such, including disclosure of modifications and
|
| 37 |
+
changes made to the Apple Machine Learning Research Model. The name,
|
| 38 |
+
trademarks, service marks or logos of Apple may not be used to endorse or
|
| 39 |
+
promote Model Derivatives or the relationship between You and Apple. “Model
|
| 40 |
+
Derivatives” means any models or any other artifacts created by modifications,
|
| 41 |
+
improvements, adaptations, alterations to the architecture, algorithm or
|
| 42 |
+
training processes of the Apple Machine Learning Research Model, or by any
|
| 43 |
+
retraining, fine-tuning of the Apple Machine Learning Research Model.
|
| 44 |
+
|
| 45 |
+
* No Other License: Except as expressly stated in this notice, no other rights
|
| 46 |
+
or licenses, express or implied, are granted by Apple herein, including but
|
| 47 |
+
not limited to any patent, trademark, and similar intellectual property rights
|
| 48 |
+
worldwide that may be infringed by the Apple Machine Learning Research Model,
|
| 49 |
+
the Model Derivatives or by other works in which the Apple Machine Learning
|
| 50 |
+
Research Model may be incorporated.
|
| 51 |
+
|
| 52 |
+
* Compliance with Laws: Your use of Apple Machine Learning Research Model must
|
| 53 |
+
be in compliance with all applicable laws and regulations.
|
| 54 |
+
|
| 55 |
+
* Term and Termination: The term of this Agreement will begin upon your
|
| 56 |
+
acceptance of this Agreement or use of the Apple Machine Learning Research
|
| 57 |
+
Model and will continue until terminated in accordance with the following
|
| 58 |
+
terms. Apple may terminate this Agreement at any time if You are in breach of
|
| 59 |
+
any term or condition of this Agreement. Upon termination of this Agreement,
|
| 60 |
+
You must cease to use all Apple Machine Learning Research Models and Model
|
| 61 |
+
Derivatives and permanently delete any copy thereof. Sections 3, 6 and 7 will
|
| 62 |
+
survive termination.
|
| 63 |
+
|
| 64 |
+
* Disclaimer and Limitation of Liability: This Apple Machine Learning Research
|
| 65 |
+
Model and any outputs generated by the Apple Machine Learning Research Model
|
| 66 |
+
are provided on an “AS IS” basis. APPLE MAKES NO WARRANTIES, EXPRESS OR
|
| 67 |
+
IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
|
| 68 |
+
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
|
| 69 |
+
REGARDING THE APPLE MACHINE LEARNING RESEARCH MODEL OR OUTPUTS GENERATED BY
|
| 70 |
+
THE APPLE MACHINE LEARNING RESEARCH MODEL. You are solely responsible for
|
| 71 |
+
determining the appropriateness of using or redistributing the Apple Machine
|
| 72 |
+
Learning Research Model and any outputs of the Apple Machine Learning Research
|
| 73 |
+
Model and assume any risks associated with Your use of the Apple Machine
|
| 74 |
+
Learning Research Model and any output and results. IN NO EVENT SHALL APPLE BE
|
| 75 |
+
LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
| 76 |
+
IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF
|
| 77 |
+
THE APPLE MACHINE LEARNING RESEARCH MODEL AND ANY OUTPUTS OF THE APPLE MACHINE
|
| 78 |
+
LEARNING RESEARCH MODEL, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
|
| 79 |
+
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS
|
| 80 |
+
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 81 |
+
|
| 82 |
+
* Governing Law: This Agreement will be governed by and construed under the laws
|
| 83 |
+
of the State of California without regard to its choice of law principles. The
|
| 84 |
+
Convention on Contracts for the International Sale of Goods shall not apply to
|
| 85 |
+
the Agreement except that the arbitration clause and any arbitration hereunder
|
| 86 |
+
shall be governed by the Federal Arbitration Act, Chapters 1 and 2.
|
| 87 |
+
|
| 88 |
+
Copyright (C) 2025 Apple Inc. All Rights Reserved.
|
README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: apple-amlr
|
| 4 |
+
license_link: https://huggingface.co/AXERA-TECH/sharp-ax8860/blob/main/LICENSE_MODEL
|
| 5 |
+
pipeline_tag: image-to-3d
|
| 6 |
+
tags:
|
| 7 |
+
- gaussian-splatting
|
| 8 |
+
- 3dgs
|
| 9 |
+
- novel-view-synthesis
|
| 10 |
+
- axera
|
| 11 |
+
- ax8860
|
| 12 |
+
- npu
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# SHARP on AX8860
|
| 16 |
+
|
| 17 |
+
Single image → 3D Gaussian Splatting **on the AX8860 NPU in ~1.6 s**: Apple's [SHARP](https://github.com/apple/ml-sharp) model converted for the AXERA AX8860.
|
| 18 |
+
|
| 19 |
+
单张照片 → 3D 高斯(3DGS),**AX8860 端侧约 1.6 秒**。
|
| 20 |
+
|
| 21 |
+
Code (C++ / C API / Python / web demo): **[github.com/AXERA-TECH/sharp-ax8860](https://github.com/AXERA-TECH/sharp-ax8860)**
|
| 22 |
+
|
| 23 |
+
<p align="center"><img src="assets/ant.webp" width="808" alt="left: input photo, right: 3D Gaussians generated on AX8860, rendered from moving viewpoints"></p>
|
| 24 |
+
<p align="center"><sub>Left: input photo · Right: 3D Gaussians generated on the AX8860 board, rendered from new viewpoints</sub></p>
|
| 25 |
+
|
| 26 |
+
## Performance
|
| 27 |
+
|
| 28 |
+
| Stage | Time (ms) | Where |
|
| 29 |
+
|---|---:|---|
|
| 30 |
+
| JPEG decode (hardware JDEC) | 20–60 | VDEC |
|
| 31 |
+
| Pre-process | ~70 | CPU |
|
| 32 |
+
| ViT ×36 (DINOv2-L, FP8) | ~760 | NPU |
|
| 33 |
+
| Tail (DPT + Gaussian decoder, U16) | ~490 | NPU |
|
| 34 |
+
| Depth head last layer (FP32) | ~50 | CPU |
|
| 35 |
+
| Post-process | ~160 | CPU |
|
| 36 |
+
| Write SPZ / PLY | ~170 / ~65 | CPU |
|
| 37 |
+
| **End-to-end** | **~1600–1700** | |
|
| 38 |
+
|
| 39 |
+
AX8860, 4 NPU cores, SDK V0.6.0. Model loading (once): ~0.8 s. Output: 1,179,648 Gaussians, SPZ 12–17 MB or PLY 66 MB.
|
| 40 |
+
|
| 41 |
+
Quality vs. the official FP32 model on GPU (renderings from 4 shifted viewpoints, photos not used for calibration): median PSNR **41.9 dB** on 29 COCO photos, **33.9 dB** on 50 DIV2K photos.
|
| 42 |
+
|
| 43 |
+
## Files
|
| 44 |
+
|
| 45 |
+
```
|
| 46 |
+
models/
|
| 47 |
+
├── fp8vit/ # DINOv2-L ViT (patch + image encoder): FP8 kernels + weight banks
|
| 48 |
+
├── sharp_tail.axmodel # DPT decoder + Gaussian decoder, U16
|
| 49 |
+
└── h4_wb.bin # last 1x1 conv of the depth head (fp32, run on the CPU)
|
| 50 |
+
bin/
|
| 51 |
+
├── sharp_ax # command line tool (aarch64, glibc >= 2.38)
|
| 52 |
+
└── libsharp_ax.so # C API for Python / other languages
|
| 53 |
+
python/
|
| 54 |
+
├── sharp_ax.py # ctypes binding
|
| 55 |
+
├── web_demo.py # browser demo served from the board
|
| 56 |
+
└── web_demo.html
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## Usage
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
# command line: .spz = SPZ v2, .ply = same PLY layout as ml-sharp
|
| 63 |
+
LD_LIBRARY_PATH=/opt/lib ./bin/sharp_ax -m models -i photo.jpg -o photo.spz
|
| 64 |
+
|
| 65 |
+
# Python (standard library only)
|
| 66 |
+
cp bin/libsharp_ax.so python/ && cd python
|
| 67 |
+
python3 -c "from sharp_ax import Sharp; print(Sharp('../models').run('photo.jpg', 'photo.spz'))"
|
| 68 |
+
|
| 69 |
+
# web demo: open http://<board-ip>:8080, upload a photo, view the result in the browser
|
| 70 |
+
python3 web_demo.py -m ../models --port 8080
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
The `.spz` result can also be opened in viewers such as [SuperSplat](https://superspl.at/editor).
|
| 74 |
+
|
| 75 |
+
## Model derivative and license
|
| 76 |
+
|
| 77 |
+
*Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement.*
|
| 78 |
+
|
| 79 |
+
These files are **model derivatives** of Apple's SHARP checkpoint, released under the [Apple Machine Learning Research Model License](LICENSE_MODEL) — **for non-commercial research purposes only**. This project is not affiliated with or endorsed by Apple.
|
| 80 |
+
|
| 81 |
+
Changes made to the original model:
|
| 82 |
+
|
| 83 |
+
- Split into a ViT part (DINOv2-L patch and image encoders, run 35 + 1 times per image) and a decoder part (DPT + Gaussian decoder).
|
| 84 |
+
- ViT weights and activations quantized to FP8 and run with custom NPU kernels.
|
| 85 |
+
- Decoder compiled with pulsar2 using U16 activations (INT8 weights), calibrated on 80 photos; 16-bit tensors above 128 MiB split along channels; the image is fed as a 2×2 space-to-depth tensor.
|
| 86 |
+
- The last 1×1 convolution of the depth head is taken out of the NPU graph and computed on the CPU in FP32.
|
| 87 |
+
- Pre- and post-processing re-implemented in C++; optional SPZ output (quantized positions/attributes).
|
| 88 |
+
|
| 89 |
+
Demo photo: [Pexels](https://www.pexels.com) (Niko Desmon).
|
assets/ant.webp
ADDED
|
Git LFS Details
|
bin/libsharp_ax.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:553c79b8bcc34624856f92cc6a365e16760dbe7f752e21f89b0fe1fbc6037d38
|
| 3 |
+
size 382536
|
bin/sharp_ax
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a9b5431efc56782fac5f4d14d03da55109513513cb64cff657acb9fc7dc352e
|
| 3 |
+
size 320088
|
models/fp8vit/image.bank
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87ddc1ea5df32b15bea54094e283553699bfed5ee497ef6a95f1224c25d873f0
|
| 3 |
+
size 307248384
|
models/fp8vit/image.idx
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
b0_down 0 4194304 uint8 1024x4096
|
| 2 |
+
b0_down_b 4194304 4096 float32 1024
|
| 3 |
+
b0_down_s 4198400 4096 float32 1024x1
|
| 4 |
+
b0_ln1_b 4202496 4096 float32 1024
|
| 5 |
+
b0_ln1_w 4206592 4096 float32 1024
|
| 6 |
+
b0_ln2_b 4210688 4096 float32 1024
|
| 7 |
+
b0_ln2_w 4214784 4096 float32 1024
|
| 8 |
+
b0_ls1 4218880 4096 float32 1024
|
| 9 |
+
b0_ls2 4222976 4096 float32 1024
|
| 10 |
+
b0_o 4227072 1048576 uint8 1024x1024
|
| 11 |
+
b0_o_b 5275648 4096 float32 1024
|
| 12 |
+
b0_o_s 5279744 4096 float32 1024x1
|
| 13 |
+
b0_qkv 5283840 3145728 uint8 3072x1024
|
| 14 |
+
b0_qkv_b 8429568 12288 float32 3072
|
| 15 |
+
b0_qkv_s 8441856 12288 float32 3072x1
|
| 16 |
+
b0_up 8454144 4194304 uint8 4096x1024
|
| 17 |
+
b0_up_b 12648448 16384 float32 4096
|
| 18 |
+
b0_up_s 12664832 16384 float32 4096x1
|
| 19 |
+
b10_down 12681216 4194304 uint8 1024x4096
|
| 20 |
+
b10_down_b 16875520 4096 float32 1024
|
| 21 |
+
b10_down_s 16879616 4096 float32 1024x1
|
| 22 |
+
b10_ln1_b 16883712 4096 float32 1024
|
| 23 |
+
b10_ln1_w 16887808 4096 float32 1024
|
| 24 |
+
b10_ln2_b 16891904 4096 float32 1024
|
| 25 |
+
b10_ln2_w 16896000 4096 float32 1024
|
| 26 |
+
b10_ls1 16900096 4096 float32 1024
|
| 27 |
+
b10_ls2 16904192 4096 float32 1024
|
| 28 |
+
b10_o 16908288 1048576 uint8 1024x1024
|
| 29 |
+
b10_o_b 17956864 4096 float32 1024
|
| 30 |
+
b10_o_s 17960960 4096 float32 1024x1
|
| 31 |
+
b10_qkv 17965056 3145728 uint8 3072x1024
|
| 32 |
+
b10_qkv_b 21110784 12288 float32 3072
|
| 33 |
+
b10_qkv_s 21123072 12288 float32 3072x1
|
| 34 |
+
b10_up 21135360 4194304 uint8 4096x1024
|
| 35 |
+
b10_up_b 25329664 16384 float32 4096
|
| 36 |
+
b10_up_s 25346048 16384 float32 4096x1
|
| 37 |
+
b11_down 25362432 4194304 uint8 1024x4096
|
| 38 |
+
b11_down_b 29556736 4096 float32 1024
|
| 39 |
+
b11_down_s 29560832 4096 float32 1024x1
|
| 40 |
+
b11_ln1_b 29564928 4096 float32 1024
|
| 41 |
+
b11_ln1_w 29569024 4096 float32 1024
|
| 42 |
+
b11_ln2_b 29573120 4096 float32 1024
|
| 43 |
+
b11_ln2_w 29577216 4096 float32 1024
|
| 44 |
+
b11_ls1 29581312 4096 float32 1024
|
| 45 |
+
b11_ls2 29585408 4096 float32 1024
|
| 46 |
+
b11_o 29589504 1048576 uint8 1024x1024
|
| 47 |
+
b11_o_b 30638080 4096 float32 1024
|
| 48 |
+
b11_o_s 30642176 4096 float32 1024x1
|
| 49 |
+
b11_qkv 30646272 3145728 uint8 3072x1024
|
| 50 |
+
b11_qkv_b 33792000 12288 float32 3072
|
| 51 |
+
b11_qkv_s 33804288 12288 float32 3072x1
|
| 52 |
+
b11_up 33816576 4194304 uint8 4096x1024
|
| 53 |
+
b11_up_b 38010880 16384 float32 4096
|
| 54 |
+
b11_up_s 38027264 16384 float32 4096x1
|
| 55 |
+
b12_down 38043648 4194304 uint8 1024x4096
|
| 56 |
+
b12_down_b 42237952 4096 float32 1024
|
| 57 |
+
b12_down_s 42242048 4096 float32 1024x1
|
| 58 |
+
b12_ln1_b 42246144 4096 float32 1024
|
| 59 |
+
b12_ln1_w 42250240 4096 float32 1024
|
| 60 |
+
b12_ln2_b 42254336 4096 float32 1024
|
| 61 |
+
b12_ln2_w 42258432 4096 float32 1024
|
| 62 |
+
b12_ls1 42262528 4096 float32 1024
|
| 63 |
+
b12_ls2 42266624 4096 float32 1024
|
| 64 |
+
b12_o 42270720 1048576 uint8 1024x1024
|
| 65 |
+
b12_o_b 43319296 4096 float32 1024
|
| 66 |
+
b12_o_s 43323392 4096 float32 1024x1
|
| 67 |
+
b12_qkv 43327488 3145728 uint8 3072x1024
|
| 68 |
+
b12_qkv_b 46473216 12288 float32 3072
|
| 69 |
+
b12_qkv_s 46485504 12288 float32 3072x1
|
| 70 |
+
b12_up 46497792 4194304 uint8 4096x1024
|
| 71 |
+
b12_up_b 50692096 16384 float32 4096
|
| 72 |
+
b12_up_s 50708480 16384 float32 4096x1
|
| 73 |
+
b13_down 50724864 4194304 uint8 1024x4096
|
| 74 |
+
b13_down_b 54919168 4096 float32 1024
|
| 75 |
+
b13_down_s 54923264 4096 float32 1024x1
|
| 76 |
+
b13_ln1_b 54927360 4096 float32 1024
|
| 77 |
+
b13_ln1_w 54931456 4096 float32 1024
|
| 78 |
+
b13_ln2_b 54935552 4096 float32 1024
|
| 79 |
+
b13_ln2_w 54939648 4096 float32 1024
|
| 80 |
+
b13_ls1 54943744 4096 float32 1024
|
| 81 |
+
b13_ls2 54947840 4096 float32 1024
|
| 82 |
+
b13_o 54951936 1048576 uint8 1024x1024
|
| 83 |
+
b13_o_b 56000512 4096 float32 1024
|
| 84 |
+
b13_o_s 56004608 4096 float32 1024x1
|
| 85 |
+
b13_qkv 56008704 3145728 uint8 3072x1024
|
| 86 |
+
b13_qkv_b 59154432 12288 float32 3072
|
| 87 |
+
b13_qkv_s 59166720 12288 float32 3072x1
|
| 88 |
+
b13_up 59179008 4194304 uint8 4096x1024
|
| 89 |
+
b13_up_b 63373312 16384 float32 4096
|
| 90 |
+
b13_up_s 63389696 16384 float32 4096x1
|
| 91 |
+
b14_down 63406080 4194304 uint8 1024x4096
|
| 92 |
+
b14_down_b 67600384 4096 float32 1024
|
| 93 |
+
b14_down_s 67604480 4096 float32 1024x1
|
| 94 |
+
b14_ln1_b 67608576 4096 float32 1024
|
| 95 |
+
b14_ln1_w 67612672 4096 float32 1024
|
| 96 |
+
b14_ln2_b 67616768 4096 float32 1024
|
| 97 |
+
b14_ln2_w 67620864 4096 float32 1024
|
| 98 |
+
b14_ls1 67624960 4096 float32 1024
|
| 99 |
+
b14_ls2 67629056 4096 float32 1024
|
| 100 |
+
b14_o 67633152 1048576 uint8 1024x1024
|
| 101 |
+
b14_o_b 68681728 4096 float32 1024
|
| 102 |
+
b14_o_s 68685824 4096 float32 1024x1
|
| 103 |
+
b14_qkv 68689920 3145728 uint8 3072x1024
|
| 104 |
+
b14_qkv_b 71835648 12288 float32 3072
|
| 105 |
+
b14_qkv_s 71847936 12288 float32 3072x1
|
| 106 |
+
b14_up 71860224 4194304 uint8 4096x1024
|
| 107 |
+
b14_up_b 76054528 16384 float32 4096
|
| 108 |
+
b14_up_s 76070912 16384 float32 4096x1
|
| 109 |
+
b15_down 76087296 4194304 uint8 1024x4096
|
| 110 |
+
b15_down_b 80281600 4096 float32 1024
|
| 111 |
+
b15_down_s 80285696 4096 float32 1024x1
|
| 112 |
+
b15_ln1_b 80289792 4096 float32 1024
|
| 113 |
+
b15_ln1_w 80293888 4096 float32 1024
|
| 114 |
+
b15_ln2_b 80297984 4096 float32 1024
|
| 115 |
+
b15_ln2_w 80302080 4096 float32 1024
|
| 116 |
+
b15_ls1 80306176 4096 float32 1024
|
| 117 |
+
b15_ls2 80310272 4096 float32 1024
|
| 118 |
+
b15_o 80314368 1048576 uint8 1024x1024
|
| 119 |
+
b15_o_b 81362944 4096 float32 1024
|
| 120 |
+
b15_o_s 81367040 4096 float32 1024x1
|
| 121 |
+
b15_qkv 81371136 3145728 uint8 3072x1024
|
| 122 |
+
b15_qkv_b 84516864 12288 float32 3072
|
| 123 |
+
b15_qkv_s 84529152 12288 float32 3072x1
|
| 124 |
+
b15_up 84541440 4194304 uint8 4096x1024
|
| 125 |
+
b15_up_b 88735744 16384 float32 4096
|
| 126 |
+
b15_up_s 88752128 16384 float32 4096x1
|
| 127 |
+
b16_down 88768512 4194304 uint8 1024x4096
|
| 128 |
+
b16_down_b 92962816 4096 float32 1024
|
| 129 |
+
b16_down_s 92966912 4096 float32 1024x1
|
| 130 |
+
b16_ln1_b 92971008 4096 float32 1024
|
| 131 |
+
b16_ln1_w 92975104 4096 float32 1024
|
| 132 |
+
b16_ln2_b 92979200 4096 float32 1024
|
| 133 |
+
b16_ln2_w 92983296 4096 float32 1024
|
| 134 |
+
b16_ls1 92987392 4096 float32 1024
|
| 135 |
+
b16_ls2 92991488 4096 float32 1024
|
| 136 |
+
b16_o 92995584 1048576 uint8 1024x1024
|
| 137 |
+
b16_o_b 94044160 4096 float32 1024
|
| 138 |
+
b16_o_s 94048256 4096 float32 1024x1
|
| 139 |
+
b16_qkv 94052352 3145728 uint8 3072x1024
|
| 140 |
+
b16_qkv_b 97198080 12288 float32 3072
|
| 141 |
+
b16_qkv_s 97210368 12288 float32 3072x1
|
| 142 |
+
b16_up 97222656 4194304 uint8 4096x1024
|
| 143 |
+
b16_up_b 101416960 16384 float32 4096
|
| 144 |
+
b16_up_s 101433344 16384 float32 4096x1
|
| 145 |
+
b17_down 101449728 4194304 uint8 1024x4096
|
| 146 |
+
b17_down_b 105644032 4096 float32 1024
|
| 147 |
+
b17_down_s 105648128 4096 float32 1024x1
|
| 148 |
+
b17_ln1_b 105652224 4096 float32 1024
|
| 149 |
+
b17_ln1_w 105656320 4096 float32 1024
|
| 150 |
+
b17_ln2_b 105660416 4096 float32 1024
|
| 151 |
+
b17_ln2_w 105664512 4096 float32 1024
|
| 152 |
+
b17_ls1 105668608 4096 float32 1024
|
| 153 |
+
b17_ls2 105672704 4096 float32 1024
|
| 154 |
+
b17_o 105676800 1048576 uint8 1024x1024
|
| 155 |
+
b17_o_b 106725376 4096 float32 1024
|
| 156 |
+
b17_o_s 106729472 4096 float32 1024x1
|
| 157 |
+
b17_qkv 106733568 3145728 uint8 3072x1024
|
| 158 |
+
b17_qkv_b 109879296 12288 float32 3072
|
| 159 |
+
b17_qkv_s 109891584 12288 float32 3072x1
|
| 160 |
+
b17_up 109903872 4194304 uint8 4096x1024
|
| 161 |
+
b17_up_b 114098176 16384 float32 4096
|
| 162 |
+
b17_up_s 114114560 16384 float32 4096x1
|
| 163 |
+
b18_down 114130944 4194304 uint8 1024x4096
|
| 164 |
+
b18_down_b 118325248 4096 float32 1024
|
| 165 |
+
b18_down_s 118329344 4096 float32 1024x1
|
| 166 |
+
b18_ln1_b 118333440 4096 float32 1024
|
| 167 |
+
b18_ln1_w 118337536 4096 float32 1024
|
| 168 |
+
b18_ln2_b 118341632 4096 float32 1024
|
| 169 |
+
b18_ln2_w 118345728 4096 float32 1024
|
| 170 |
+
b18_ls1 118349824 4096 float32 1024
|
| 171 |
+
b18_ls2 118353920 4096 float32 1024
|
| 172 |
+
b18_o 118358016 1048576 uint8 1024x1024
|
| 173 |
+
b18_o_b 119406592 4096 float32 1024
|
| 174 |
+
b18_o_s 119410688 4096 float32 1024x1
|
| 175 |
+
b18_qkv 119414784 3145728 uint8 3072x1024
|
| 176 |
+
b18_qkv_b 122560512 12288 float32 3072
|
| 177 |
+
b18_qkv_s 122572800 12288 float32 3072x1
|
| 178 |
+
b18_up 122585088 4194304 uint8 4096x1024
|
| 179 |
+
b18_up_b 126779392 16384 float32 4096
|
| 180 |
+
b18_up_s 126795776 16384 float32 4096x1
|
| 181 |
+
b19_down 126812160 4194304 uint8 1024x4096
|
| 182 |
+
b19_down_b 131006464 4096 float32 1024
|
| 183 |
+
b19_down_s 131010560 4096 float32 1024x1
|
| 184 |
+
b19_ln1_b 131014656 4096 float32 1024
|
| 185 |
+
b19_ln1_w 131018752 4096 float32 1024
|
| 186 |
+
b19_ln2_b 131022848 4096 float32 1024
|
| 187 |
+
b19_ln2_w 131026944 4096 float32 1024
|
| 188 |
+
b19_ls1 131031040 4096 float32 1024
|
| 189 |
+
b19_ls2 131035136 4096 float32 1024
|
| 190 |
+
b19_o 131039232 1048576 uint8 1024x1024
|
| 191 |
+
b19_o_b 132087808 4096 float32 1024
|
| 192 |
+
b19_o_s 132091904 4096 float32 1024x1
|
| 193 |
+
b19_qkv 132096000 3145728 uint8 3072x1024
|
| 194 |
+
b19_qkv_b 135241728 12288 float32 3072
|
| 195 |
+
b19_qkv_s 135254016 12288 float32 3072x1
|
| 196 |
+
b19_up 135266304 4194304 uint8 4096x1024
|
| 197 |
+
b19_up_b 139460608 16384 float32 4096
|
| 198 |
+
b19_up_s 139476992 16384 float32 4096x1
|
| 199 |
+
b1_down 139493376 4194304 uint8 1024x4096
|
| 200 |
+
b1_down_b 143687680 4096 float32 1024
|
| 201 |
+
b1_down_s 143691776 4096 float32 1024x1
|
| 202 |
+
b1_ln1_b 143695872 4096 float32 1024
|
| 203 |
+
b1_ln1_w 143699968 4096 float32 1024
|
| 204 |
+
b1_ln2_b 143704064 4096 float32 1024
|
| 205 |
+
b1_ln2_w 143708160 4096 float32 1024
|
| 206 |
+
b1_ls1 143712256 4096 float32 1024
|
| 207 |
+
b1_ls2 143716352 4096 float32 1024
|
| 208 |
+
b1_o 143720448 1048576 uint8 1024x1024
|
| 209 |
+
b1_o_b 144769024 4096 float32 1024
|
| 210 |
+
b1_o_s 144773120 4096 float32 1024x1
|
| 211 |
+
b1_qkv 144777216 3145728 uint8 3072x1024
|
| 212 |
+
b1_qkv_b 147922944 12288 float32 3072
|
| 213 |
+
b1_qkv_s 147935232 12288 float32 3072x1
|
| 214 |
+
b1_up 147947520 4194304 uint8 4096x1024
|
| 215 |
+
b1_up_b 152141824 16384 float32 4096
|
| 216 |
+
b1_up_s 152158208 16384 float32 4096x1
|
| 217 |
+
b20_down 152174592 4194304 uint8 1024x4096
|
| 218 |
+
b20_down_b 156368896 4096 float32 1024
|
| 219 |
+
b20_down_s 156372992 4096 float32 1024x1
|
| 220 |
+
b20_ln1_b 156377088 4096 float32 1024
|
| 221 |
+
b20_ln1_w 156381184 4096 float32 1024
|
| 222 |
+
b20_ln2_b 156385280 4096 float32 1024
|
| 223 |
+
b20_ln2_w 156389376 4096 float32 1024
|
| 224 |
+
b20_ls1 156393472 4096 float32 1024
|
| 225 |
+
b20_ls2 156397568 4096 float32 1024
|
| 226 |
+
b20_o 156401664 1048576 uint8 1024x1024
|
| 227 |
+
b20_o_b 157450240 4096 float32 1024
|
| 228 |
+
b20_o_s 157454336 4096 float32 1024x1
|
| 229 |
+
b20_qkv 157458432 3145728 uint8 3072x1024
|
| 230 |
+
b20_qkv_b 160604160 12288 float32 3072
|
| 231 |
+
b20_qkv_s 160616448 12288 float32 3072x1
|
| 232 |
+
b20_up 160628736 4194304 uint8 4096x1024
|
| 233 |
+
b20_up_b 164823040 16384 float32 4096
|
| 234 |
+
b20_up_s 164839424 16384 float32 4096x1
|
| 235 |
+
b21_down 164855808 4194304 uint8 1024x4096
|
| 236 |
+
b21_down_b 169050112 4096 float32 1024
|
| 237 |
+
b21_down_s 169054208 4096 float32 1024x1
|
| 238 |
+
b21_ln1_b 169058304 4096 float32 1024
|
| 239 |
+
b21_ln1_w 169062400 4096 float32 1024
|
| 240 |
+
b21_ln2_b 169066496 4096 float32 1024
|
| 241 |
+
b21_ln2_w 169070592 4096 float32 1024
|
| 242 |
+
b21_ls1 169074688 4096 float32 1024
|
| 243 |
+
b21_ls2 169078784 4096 float32 1024
|
| 244 |
+
b21_o 169082880 1048576 uint8 1024x1024
|
| 245 |
+
b21_o_b 170131456 4096 float32 1024
|
| 246 |
+
b21_o_s 170135552 4096 float32 1024x1
|
| 247 |
+
b21_qkv 170139648 3145728 uint8 3072x1024
|
| 248 |
+
b21_qkv_b 173285376 12288 float32 3072
|
| 249 |
+
b21_qkv_s 173297664 12288 float32 3072x1
|
| 250 |
+
b21_up 173309952 4194304 uint8 4096x1024
|
| 251 |
+
b21_up_b 177504256 16384 float32 4096
|
| 252 |
+
b21_up_s 177520640 16384 float32 4096x1
|
| 253 |
+
b22_down 177537024 4194304 uint8 1024x4096
|
| 254 |
+
b22_down_b 181731328 4096 float32 1024
|
| 255 |
+
b22_down_s 181735424 4096 float32 1024x1
|
| 256 |
+
b22_ln1_b 181739520 4096 float32 1024
|
| 257 |
+
b22_ln1_w 181743616 4096 float32 1024
|
| 258 |
+
b22_ln2_b 181747712 4096 float32 1024
|
| 259 |
+
b22_ln2_w 181751808 4096 float32 1024
|
| 260 |
+
b22_ls1 181755904 4096 float32 1024
|
| 261 |
+
b22_ls2 181760000 4096 float32 1024
|
| 262 |
+
b22_o 181764096 1048576 uint8 1024x1024
|
| 263 |
+
b22_o_b 182812672 4096 float32 1024
|
| 264 |
+
b22_o_s 182816768 4096 float32 1024x1
|
| 265 |
+
b22_qkv 182820864 3145728 uint8 3072x1024
|
| 266 |
+
b22_qkv_b 185966592 12288 float32 3072
|
| 267 |
+
b22_qkv_s 185978880 12288 float32 3072x1
|
| 268 |
+
b22_up 185991168 4194304 uint8 4096x1024
|
| 269 |
+
b22_up_b 190185472 16384 float32 4096
|
| 270 |
+
b22_up_s 190201856 16384 float32 4096x1
|
| 271 |
+
b23_down 190218240 4194304 uint8 1024x4096
|
| 272 |
+
b23_down_b 194412544 4096 float32 1024
|
| 273 |
+
b23_down_s 194416640 4096 float32 1024x1
|
| 274 |
+
b23_ln1_b 194420736 4096 float32 1024
|
| 275 |
+
b23_ln1_w 194424832 4096 float32 1024
|
| 276 |
+
b23_ln2_b 194428928 4096 float32 1024
|
| 277 |
+
b23_ln2_w 194433024 4096 float32 1024
|
| 278 |
+
b23_ls1 194437120 4096 float32 1024
|
| 279 |
+
b23_ls2 194441216 4096 float32 1024
|
| 280 |
+
b23_o 194445312 1048576 uint8 1024x1024
|
| 281 |
+
b23_o_b 195493888 4096 float32 1024
|
| 282 |
+
b23_o_s 195497984 4096 float32 1024x1
|
| 283 |
+
b23_qkv 195502080 3145728 uint8 3072x1024
|
| 284 |
+
b23_qkv_b 198647808 12288 float32 3072
|
| 285 |
+
b23_qkv_s 198660096 12288 float32 3072x1
|
| 286 |
+
b23_up 198672384 4194304 uint8 4096x1024
|
| 287 |
+
b23_up_b 202866688 16384 float32 4096
|
| 288 |
+
b23_up_s 202883072 16384 float32 4096x1
|
| 289 |
+
b2_down 202899456 4194304 uint8 1024x4096
|
| 290 |
+
b2_down_b 207093760 4096 float32 1024
|
| 291 |
+
b2_down_s 207097856 4096 float32 1024x1
|
| 292 |
+
b2_ln1_b 207101952 4096 float32 1024
|
| 293 |
+
b2_ln1_w 207106048 4096 float32 1024
|
| 294 |
+
b2_ln2_b 207110144 4096 float32 1024
|
| 295 |
+
b2_ln2_w 207114240 4096 float32 1024
|
| 296 |
+
b2_ls1 207118336 4096 float32 1024
|
| 297 |
+
b2_ls2 207122432 4096 float32 1024
|
| 298 |
+
b2_o 207126528 1048576 uint8 1024x1024
|
| 299 |
+
b2_o_b 208175104 4096 float32 1024
|
| 300 |
+
b2_o_s 208179200 4096 float32 1024x1
|
| 301 |
+
b2_qkv 208183296 3145728 uint8 3072x1024
|
| 302 |
+
b2_qkv_b 211329024 12288 float32 3072
|
| 303 |
+
b2_qkv_s 211341312 12288 float32 3072x1
|
| 304 |
+
b2_up 211353600 4194304 uint8 4096x1024
|
| 305 |
+
b2_up_b 215547904 16384 float32 4096
|
| 306 |
+
b2_up_s 215564288 16384 float32 4096x1
|
| 307 |
+
b3_down 215580672 4194304 uint8 1024x4096
|
| 308 |
+
b3_down_b 219774976 4096 float32 1024
|
| 309 |
+
b3_down_s 219779072 4096 float32 1024x1
|
| 310 |
+
b3_ln1_b 219783168 4096 float32 1024
|
| 311 |
+
b3_ln1_w 219787264 4096 float32 1024
|
| 312 |
+
b3_ln2_b 219791360 4096 float32 1024
|
| 313 |
+
b3_ln2_w 219795456 4096 float32 1024
|
| 314 |
+
b3_ls1 219799552 4096 float32 1024
|
| 315 |
+
b3_ls2 219803648 4096 float32 1024
|
| 316 |
+
b3_o 219807744 1048576 uint8 1024x1024
|
| 317 |
+
b3_o_b 220856320 4096 float32 1024
|
| 318 |
+
b3_o_s 220860416 4096 float32 1024x1
|
| 319 |
+
b3_qkv 220864512 3145728 uint8 3072x1024
|
| 320 |
+
b3_qkv_b 224010240 12288 float32 3072
|
| 321 |
+
b3_qkv_s 224022528 12288 float32 3072x1
|
| 322 |
+
b3_up 224034816 4194304 uint8 4096x1024
|
| 323 |
+
b3_up_b 228229120 16384 float32 4096
|
| 324 |
+
b3_up_s 228245504 16384 float32 4096x1
|
| 325 |
+
b4_down 228261888 4194304 uint8 1024x4096
|
| 326 |
+
b4_down_b 232456192 4096 float32 1024
|
| 327 |
+
b4_down_s 232460288 4096 float32 1024x1
|
| 328 |
+
b4_ln1_b 232464384 4096 float32 1024
|
| 329 |
+
b4_ln1_w 232468480 4096 float32 1024
|
| 330 |
+
b4_ln2_b 232472576 4096 float32 1024
|
| 331 |
+
b4_ln2_w 232476672 4096 float32 1024
|
| 332 |
+
b4_ls1 232480768 4096 float32 1024
|
| 333 |
+
b4_ls2 232484864 4096 float32 1024
|
| 334 |
+
b4_o 232488960 1048576 uint8 1024x1024
|
| 335 |
+
b4_o_b 233537536 4096 float32 1024
|
| 336 |
+
b4_o_s 233541632 4096 float32 1024x1
|
| 337 |
+
b4_qkv 233545728 3145728 uint8 3072x1024
|
| 338 |
+
b4_qkv_b 236691456 12288 float32 3072
|
| 339 |
+
b4_qkv_s 236703744 12288 float32 3072x1
|
| 340 |
+
b4_up 236716032 4194304 uint8 4096x1024
|
| 341 |
+
b4_up_b 240910336 16384 float32 4096
|
| 342 |
+
b4_up_s 240926720 16384 float32 4096x1
|
| 343 |
+
b5_down 240943104 4194304 uint8 1024x4096
|
| 344 |
+
b5_down_b 245137408 4096 float32 1024
|
| 345 |
+
b5_down_s 245141504 4096 float32 1024x1
|
| 346 |
+
b5_ln1_b 245145600 4096 float32 1024
|
| 347 |
+
b5_ln1_w 245149696 4096 float32 1024
|
| 348 |
+
b5_ln2_b 245153792 4096 float32 1024
|
| 349 |
+
b5_ln2_w 245157888 4096 float32 1024
|
| 350 |
+
b5_ls1 245161984 4096 float32 1024
|
| 351 |
+
b5_ls2 245166080 4096 float32 1024
|
| 352 |
+
b5_o 245170176 1048576 uint8 1024x1024
|
| 353 |
+
b5_o_b 246218752 4096 float32 1024
|
| 354 |
+
b5_o_s 246222848 4096 float32 1024x1
|
| 355 |
+
b5_qkv 246226944 3145728 uint8 3072x1024
|
| 356 |
+
b5_qkv_b 249372672 12288 float32 3072
|
| 357 |
+
b5_qkv_s 249384960 12288 float32 3072x1
|
| 358 |
+
b5_up 249397248 4194304 uint8 4096x1024
|
| 359 |
+
b5_up_b 253591552 16384 float32 4096
|
| 360 |
+
b5_up_s 253607936 16384 float32 4096x1
|
| 361 |
+
b6_down 253624320 4194304 uint8 1024x4096
|
| 362 |
+
b6_down_b 257818624 4096 float32 1024
|
| 363 |
+
b6_down_s 257822720 4096 float32 1024x1
|
| 364 |
+
b6_ln1_b 257826816 4096 float32 1024
|
| 365 |
+
b6_ln1_w 257830912 4096 float32 1024
|
| 366 |
+
b6_ln2_b 257835008 4096 float32 1024
|
| 367 |
+
b6_ln2_w 257839104 4096 float32 1024
|
| 368 |
+
b6_ls1 257843200 4096 float32 1024
|
| 369 |
+
b6_ls2 257847296 4096 float32 1024
|
| 370 |
+
b6_o 257851392 1048576 uint8 1024x1024
|
| 371 |
+
b6_o_b 258899968 4096 float32 1024
|
| 372 |
+
b6_o_s 258904064 4096 float32 1024x1
|
| 373 |
+
b6_qkv 258908160 3145728 uint8 3072x1024
|
| 374 |
+
b6_qkv_b 262053888 12288 float32 3072
|
| 375 |
+
b6_qkv_s 262066176 12288 float32 3072x1
|
| 376 |
+
b6_up 262078464 4194304 uint8 4096x1024
|
| 377 |
+
b6_up_b 266272768 16384 float32 4096
|
| 378 |
+
b6_up_s 266289152 16384 float32 4096x1
|
| 379 |
+
b7_down 266305536 4194304 uint8 1024x4096
|
| 380 |
+
b7_down_b 270499840 4096 float32 1024
|
| 381 |
+
b7_down_s 270503936 4096 float32 1024x1
|
| 382 |
+
b7_ln1_b 270508032 4096 float32 1024
|
| 383 |
+
b7_ln1_w 270512128 4096 float32 1024
|
| 384 |
+
b7_ln2_b 270516224 4096 float32 1024
|
| 385 |
+
b7_ln2_w 270520320 4096 float32 1024
|
| 386 |
+
b7_ls1 270524416 4096 float32 1024
|
| 387 |
+
b7_ls2 270528512 4096 float32 1024
|
| 388 |
+
b7_o 270532608 1048576 uint8 1024x1024
|
| 389 |
+
b7_o_b 271581184 4096 float32 1024
|
| 390 |
+
b7_o_s 271585280 4096 float32 1024x1
|
| 391 |
+
b7_qkv 271589376 3145728 uint8 3072x1024
|
| 392 |
+
b7_qkv_b 274735104 12288 float32 3072
|
| 393 |
+
b7_qkv_s 274747392 12288 float32 3072x1
|
| 394 |
+
b7_up 274759680 4194304 uint8 4096x1024
|
| 395 |
+
b7_up_b 278953984 16384 float32 4096
|
| 396 |
+
b7_up_s 278970368 16384 float32 4096x1
|
| 397 |
+
b8_down 278986752 4194304 uint8 1024x4096
|
| 398 |
+
b8_down_b 283181056 4096 float32 1024
|
| 399 |
+
b8_down_s 283185152 4096 float32 1024x1
|
| 400 |
+
b8_ln1_b 283189248 4096 float32 1024
|
| 401 |
+
b8_ln1_w 283193344 4096 float32 1024
|
| 402 |
+
b8_ln2_b 283197440 4096 float32 1024
|
| 403 |
+
b8_ln2_w 283201536 4096 float32 1024
|
| 404 |
+
b8_ls1 283205632 4096 float32 1024
|
| 405 |
+
b8_ls2 283209728 4096 float32 1024
|
| 406 |
+
b8_o 283213824 1048576 uint8 1024x1024
|
| 407 |
+
b8_o_b 284262400 4096 float32 1024
|
| 408 |
+
b8_o_s 284266496 4096 float32 1024x1
|
| 409 |
+
b8_qkv 284270592 3145728 uint8 3072x1024
|
| 410 |
+
b8_qkv_b 287416320 12288 float32 3072
|
| 411 |
+
b8_qkv_s 287428608 12288 float32 3072x1
|
| 412 |
+
b8_up 287440896 4194304 uint8 4096x1024
|
| 413 |
+
b8_up_b 291635200 16384 float32 4096
|
| 414 |
+
b8_up_s 291651584 16384 float32 4096x1
|
| 415 |
+
b9_down 291667968 4194304 uint8 1024x4096
|
| 416 |
+
b9_down_b 295862272 4096 float32 1024
|
| 417 |
+
b9_down_s 295866368 4096 float32 1024x1
|
| 418 |
+
b9_ln1_b 295870464 4096 float32 1024
|
| 419 |
+
b9_ln1_w 295874560 4096 float32 1024
|
| 420 |
+
b9_ln2_b 295878656 4096 float32 1024
|
| 421 |
+
b9_ln2_w 295882752 4096 float32 1024
|
| 422 |
+
b9_ls1 295886848 4096 float32 1024
|
| 423 |
+
b9_ls2 295890944 4096 float32 1024
|
| 424 |
+
b9_o 295895040 1048576 uint8 1024x1024
|
| 425 |
+
b9_o_b 296943616 4096 float32 1024
|
| 426 |
+
b9_o_s 296947712 4096 float32 1024x1
|
| 427 |
+
b9_qkv 296951808 3145728 uint8 3072x1024
|
| 428 |
+
b9_qkv_b 300097536 12288 float32 3072
|
| 429 |
+
b9_qkv_s 300109824 12288 float32 3072x1
|
| 430 |
+
b9_up 300122112 4194304 uint8 4096x1024
|
| 431 |
+
b9_up_b 304316416 16384 float32 4096
|
| 432 |
+
b9_up_s 304332800 16384 float32 4096x1
|
| 433 |
+
cls 304349184 2048 uint16 1x1024
|
| 434 |
+
key_mask 304351232 1280 uint16 5x128
|
| 435 |
+
norm_b 304352512 4096 float32 1024
|
| 436 |
+
norm_w 304356608 4096 float32 1024
|
| 437 |
+
patch_b 304360704 4096 float32 1024
|
| 438 |
+
patch_w 304364800 1572864 uint16 1024x768
|
| 439 |
+
pos 305937664 1310720 uint16 640x1024
|
models/fp8vit/patch.bank
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c0095025c397153765dc3b0d88ba92f8ffedd59b0b3c090f7f75ee990f325b9
|
| 3 |
+
size 307248384
|
models/fp8vit/patch.idx
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
b0_down 0 4194304 uint8 1024x4096
|
| 2 |
+
b0_down_b 4194304 4096 float32 1024
|
| 3 |
+
b0_down_s 4198400 4096 float32 1024x1
|
| 4 |
+
b0_ln1_b 4202496 4096 float32 1024
|
| 5 |
+
b0_ln1_w 4206592 4096 float32 1024
|
| 6 |
+
b0_ln2_b 4210688 4096 float32 1024
|
| 7 |
+
b0_ln2_w 4214784 4096 float32 1024
|
| 8 |
+
b0_ls1 4218880 4096 float32 1024
|
| 9 |
+
b0_ls2 4222976 4096 float32 1024
|
| 10 |
+
b0_o 4227072 1048576 uint8 1024x1024
|
| 11 |
+
b0_o_b 5275648 4096 float32 1024
|
| 12 |
+
b0_o_s 5279744 4096 float32 1024x1
|
| 13 |
+
b0_qkv 5283840 3145728 uint8 3072x1024
|
| 14 |
+
b0_qkv_b 8429568 12288 float32 3072
|
| 15 |
+
b0_qkv_s 8441856 12288 float32 3072x1
|
| 16 |
+
b0_up 8454144 4194304 uint8 4096x1024
|
| 17 |
+
b0_up_b 12648448 16384 float32 4096
|
| 18 |
+
b0_up_s 12664832 16384 float32 4096x1
|
| 19 |
+
b10_down 12681216 4194304 uint8 1024x4096
|
| 20 |
+
b10_down_b 16875520 4096 float32 1024
|
| 21 |
+
b10_down_s 16879616 4096 float32 1024x1
|
| 22 |
+
b10_ln1_b 16883712 4096 float32 1024
|
| 23 |
+
b10_ln1_w 16887808 4096 float32 1024
|
| 24 |
+
b10_ln2_b 16891904 4096 float32 1024
|
| 25 |
+
b10_ln2_w 16896000 4096 float32 1024
|
| 26 |
+
b10_ls1 16900096 4096 float32 1024
|
| 27 |
+
b10_ls2 16904192 4096 float32 1024
|
| 28 |
+
b10_o 16908288 1048576 uint8 1024x1024
|
| 29 |
+
b10_o_b 17956864 4096 float32 1024
|
| 30 |
+
b10_o_s 17960960 4096 float32 1024x1
|
| 31 |
+
b10_qkv 17965056 3145728 uint8 3072x1024
|
| 32 |
+
b10_qkv_b 21110784 12288 float32 3072
|
| 33 |
+
b10_qkv_s 21123072 12288 float32 3072x1
|
| 34 |
+
b10_up 21135360 4194304 uint8 4096x1024
|
| 35 |
+
b10_up_b 25329664 16384 float32 4096
|
| 36 |
+
b10_up_s 25346048 16384 float32 4096x1
|
| 37 |
+
b11_down 25362432 4194304 uint8 1024x4096
|
| 38 |
+
b11_down_b 29556736 4096 float32 1024
|
| 39 |
+
b11_down_s 29560832 4096 float32 1024x1
|
| 40 |
+
b11_ln1_b 29564928 4096 float32 1024
|
| 41 |
+
b11_ln1_w 29569024 4096 float32 1024
|
| 42 |
+
b11_ln2_b 29573120 4096 float32 1024
|
| 43 |
+
b11_ln2_w 29577216 4096 float32 1024
|
| 44 |
+
b11_ls1 29581312 4096 float32 1024
|
| 45 |
+
b11_ls2 29585408 4096 float32 1024
|
| 46 |
+
b11_o 29589504 1048576 uint8 1024x1024
|
| 47 |
+
b11_o_b 30638080 4096 float32 1024
|
| 48 |
+
b11_o_s 30642176 4096 float32 1024x1
|
| 49 |
+
b11_qkv 30646272 3145728 uint8 3072x1024
|
| 50 |
+
b11_qkv_b 33792000 12288 float32 3072
|
| 51 |
+
b11_qkv_s 33804288 12288 float32 3072x1
|
| 52 |
+
b11_up 33816576 4194304 uint8 4096x1024
|
| 53 |
+
b11_up_b 38010880 16384 float32 4096
|
| 54 |
+
b11_up_s 38027264 16384 float32 4096x1
|
| 55 |
+
b12_down 38043648 4194304 uint8 1024x4096
|
| 56 |
+
b12_down_b 42237952 4096 float32 1024
|
| 57 |
+
b12_down_s 42242048 4096 float32 1024x1
|
| 58 |
+
b12_ln1_b 42246144 4096 float32 1024
|
| 59 |
+
b12_ln1_w 42250240 4096 float32 1024
|
| 60 |
+
b12_ln2_b 42254336 4096 float32 1024
|
| 61 |
+
b12_ln2_w 42258432 4096 float32 1024
|
| 62 |
+
b12_ls1 42262528 4096 float32 1024
|
| 63 |
+
b12_ls2 42266624 4096 float32 1024
|
| 64 |
+
b12_o 42270720 1048576 uint8 1024x1024
|
| 65 |
+
b12_o_b 43319296 4096 float32 1024
|
| 66 |
+
b12_o_s 43323392 4096 float32 1024x1
|
| 67 |
+
b12_qkv 43327488 3145728 uint8 3072x1024
|
| 68 |
+
b12_qkv_b 46473216 12288 float32 3072
|
| 69 |
+
b12_qkv_s 46485504 12288 float32 3072x1
|
| 70 |
+
b12_up 46497792 4194304 uint8 4096x1024
|
| 71 |
+
b12_up_b 50692096 16384 float32 4096
|
| 72 |
+
b12_up_s 50708480 16384 float32 4096x1
|
| 73 |
+
b13_down 50724864 4194304 uint8 1024x4096
|
| 74 |
+
b13_down_b 54919168 4096 float32 1024
|
| 75 |
+
b13_down_s 54923264 4096 float32 1024x1
|
| 76 |
+
b13_ln1_b 54927360 4096 float32 1024
|
| 77 |
+
b13_ln1_w 54931456 4096 float32 1024
|
| 78 |
+
b13_ln2_b 54935552 4096 float32 1024
|
| 79 |
+
b13_ln2_w 54939648 4096 float32 1024
|
| 80 |
+
b13_ls1 54943744 4096 float32 1024
|
| 81 |
+
b13_ls2 54947840 4096 float32 1024
|
| 82 |
+
b13_o 54951936 1048576 uint8 1024x1024
|
| 83 |
+
b13_o_b 56000512 4096 float32 1024
|
| 84 |
+
b13_o_s 56004608 4096 float32 1024x1
|
| 85 |
+
b13_qkv 56008704 3145728 uint8 3072x1024
|
| 86 |
+
b13_qkv_b 59154432 12288 float32 3072
|
| 87 |
+
b13_qkv_s 59166720 12288 float32 3072x1
|
| 88 |
+
b13_up 59179008 4194304 uint8 4096x1024
|
| 89 |
+
b13_up_b 63373312 16384 float32 4096
|
| 90 |
+
b13_up_s 63389696 16384 float32 4096x1
|
| 91 |
+
b14_down 63406080 4194304 uint8 1024x4096
|
| 92 |
+
b14_down_b 67600384 4096 float32 1024
|
| 93 |
+
b14_down_s 67604480 4096 float32 1024x1
|
| 94 |
+
b14_ln1_b 67608576 4096 float32 1024
|
| 95 |
+
b14_ln1_w 67612672 4096 float32 1024
|
| 96 |
+
b14_ln2_b 67616768 4096 float32 1024
|
| 97 |
+
b14_ln2_w 67620864 4096 float32 1024
|
| 98 |
+
b14_ls1 67624960 4096 float32 1024
|
| 99 |
+
b14_ls2 67629056 4096 float32 1024
|
| 100 |
+
b14_o 67633152 1048576 uint8 1024x1024
|
| 101 |
+
b14_o_b 68681728 4096 float32 1024
|
| 102 |
+
b14_o_s 68685824 4096 float32 1024x1
|
| 103 |
+
b14_qkv 68689920 3145728 uint8 3072x1024
|
| 104 |
+
b14_qkv_b 71835648 12288 float32 3072
|
| 105 |
+
b14_qkv_s 71847936 12288 float32 3072x1
|
| 106 |
+
b14_up 71860224 4194304 uint8 4096x1024
|
| 107 |
+
b14_up_b 76054528 16384 float32 4096
|
| 108 |
+
b14_up_s 76070912 16384 float32 4096x1
|
| 109 |
+
b15_down 76087296 4194304 uint8 1024x4096
|
| 110 |
+
b15_down_b 80281600 4096 float32 1024
|
| 111 |
+
b15_down_s 80285696 4096 float32 1024x1
|
| 112 |
+
b15_ln1_b 80289792 4096 float32 1024
|
| 113 |
+
b15_ln1_w 80293888 4096 float32 1024
|
| 114 |
+
b15_ln2_b 80297984 4096 float32 1024
|
| 115 |
+
b15_ln2_w 80302080 4096 float32 1024
|
| 116 |
+
b15_ls1 80306176 4096 float32 1024
|
| 117 |
+
b15_ls2 80310272 4096 float32 1024
|
| 118 |
+
b15_o 80314368 1048576 uint8 1024x1024
|
| 119 |
+
b15_o_b 81362944 4096 float32 1024
|
| 120 |
+
b15_o_s 81367040 4096 float32 1024x1
|
| 121 |
+
b15_qkv 81371136 3145728 uint8 3072x1024
|
| 122 |
+
b15_qkv_b 84516864 12288 float32 3072
|
| 123 |
+
b15_qkv_s 84529152 12288 float32 3072x1
|
| 124 |
+
b15_up 84541440 4194304 uint8 4096x1024
|
| 125 |
+
b15_up_b 88735744 16384 float32 4096
|
| 126 |
+
b15_up_s 88752128 16384 float32 4096x1
|
| 127 |
+
b16_down 88768512 4194304 uint8 1024x4096
|
| 128 |
+
b16_down_b 92962816 4096 float32 1024
|
| 129 |
+
b16_down_s 92966912 4096 float32 1024x1
|
| 130 |
+
b16_ln1_b 92971008 4096 float32 1024
|
| 131 |
+
b16_ln1_w 92975104 4096 float32 1024
|
| 132 |
+
b16_ln2_b 92979200 4096 float32 1024
|
| 133 |
+
b16_ln2_w 92983296 4096 float32 1024
|
| 134 |
+
b16_ls1 92987392 4096 float32 1024
|
| 135 |
+
b16_ls2 92991488 4096 float32 1024
|
| 136 |
+
b16_o 92995584 1048576 uint8 1024x1024
|
| 137 |
+
b16_o_b 94044160 4096 float32 1024
|
| 138 |
+
b16_o_s 94048256 4096 float32 1024x1
|
| 139 |
+
b16_qkv 94052352 3145728 uint8 3072x1024
|
| 140 |
+
b16_qkv_b 97198080 12288 float32 3072
|
| 141 |
+
b16_qkv_s 97210368 12288 float32 3072x1
|
| 142 |
+
b16_up 97222656 4194304 uint8 4096x1024
|
| 143 |
+
b16_up_b 101416960 16384 float32 4096
|
| 144 |
+
b16_up_s 101433344 16384 float32 4096x1
|
| 145 |
+
b17_down 101449728 4194304 uint8 1024x4096
|
| 146 |
+
b17_down_b 105644032 4096 float32 1024
|
| 147 |
+
b17_down_s 105648128 4096 float32 1024x1
|
| 148 |
+
b17_ln1_b 105652224 4096 float32 1024
|
| 149 |
+
b17_ln1_w 105656320 4096 float32 1024
|
| 150 |
+
b17_ln2_b 105660416 4096 float32 1024
|
| 151 |
+
b17_ln2_w 105664512 4096 float32 1024
|
| 152 |
+
b17_ls1 105668608 4096 float32 1024
|
| 153 |
+
b17_ls2 105672704 4096 float32 1024
|
| 154 |
+
b17_o 105676800 1048576 uint8 1024x1024
|
| 155 |
+
b17_o_b 106725376 4096 float32 1024
|
| 156 |
+
b17_o_s 106729472 4096 float32 1024x1
|
| 157 |
+
b17_qkv 106733568 3145728 uint8 3072x1024
|
| 158 |
+
b17_qkv_b 109879296 12288 float32 3072
|
| 159 |
+
b17_qkv_s 109891584 12288 float32 3072x1
|
| 160 |
+
b17_up 109903872 4194304 uint8 4096x1024
|
| 161 |
+
b17_up_b 114098176 16384 float32 4096
|
| 162 |
+
b17_up_s 114114560 16384 float32 4096x1
|
| 163 |
+
b18_down 114130944 4194304 uint8 1024x4096
|
| 164 |
+
b18_down_b 118325248 4096 float32 1024
|
| 165 |
+
b18_down_s 118329344 4096 float32 1024x1
|
| 166 |
+
b18_ln1_b 118333440 4096 float32 1024
|
| 167 |
+
b18_ln1_w 118337536 4096 float32 1024
|
| 168 |
+
b18_ln2_b 118341632 4096 float32 1024
|
| 169 |
+
b18_ln2_w 118345728 4096 float32 1024
|
| 170 |
+
b18_ls1 118349824 4096 float32 1024
|
| 171 |
+
b18_ls2 118353920 4096 float32 1024
|
| 172 |
+
b18_o 118358016 1048576 uint8 1024x1024
|
| 173 |
+
b18_o_b 119406592 4096 float32 1024
|
| 174 |
+
b18_o_s 119410688 4096 float32 1024x1
|
| 175 |
+
b18_qkv 119414784 3145728 uint8 3072x1024
|
| 176 |
+
b18_qkv_b 122560512 12288 float32 3072
|
| 177 |
+
b18_qkv_s 122572800 12288 float32 3072x1
|
| 178 |
+
b18_up 122585088 4194304 uint8 4096x1024
|
| 179 |
+
b18_up_b 126779392 16384 float32 4096
|
| 180 |
+
b18_up_s 126795776 16384 float32 4096x1
|
| 181 |
+
b19_down 126812160 4194304 uint8 1024x4096
|
| 182 |
+
b19_down_b 131006464 4096 float32 1024
|
| 183 |
+
b19_down_s 131010560 4096 float32 1024x1
|
| 184 |
+
b19_ln1_b 131014656 4096 float32 1024
|
| 185 |
+
b19_ln1_w 131018752 4096 float32 1024
|
| 186 |
+
b19_ln2_b 131022848 4096 float32 1024
|
| 187 |
+
b19_ln2_w 131026944 4096 float32 1024
|
| 188 |
+
b19_ls1 131031040 4096 float32 1024
|
| 189 |
+
b19_ls2 131035136 4096 float32 1024
|
| 190 |
+
b19_o 131039232 1048576 uint8 1024x1024
|
| 191 |
+
b19_o_b 132087808 4096 float32 1024
|
| 192 |
+
b19_o_s 132091904 4096 float32 1024x1
|
| 193 |
+
b19_qkv 132096000 3145728 uint8 3072x1024
|
| 194 |
+
b19_qkv_b 135241728 12288 float32 3072
|
| 195 |
+
b19_qkv_s 135254016 12288 float32 3072x1
|
| 196 |
+
b19_up 135266304 4194304 uint8 4096x1024
|
| 197 |
+
b19_up_b 139460608 16384 float32 4096
|
| 198 |
+
b19_up_s 139476992 16384 float32 4096x1
|
| 199 |
+
b1_down 139493376 4194304 uint8 1024x4096
|
| 200 |
+
b1_down_b 143687680 4096 float32 1024
|
| 201 |
+
b1_down_s 143691776 4096 float32 1024x1
|
| 202 |
+
b1_ln1_b 143695872 4096 float32 1024
|
| 203 |
+
b1_ln1_w 143699968 4096 float32 1024
|
| 204 |
+
b1_ln2_b 143704064 4096 float32 1024
|
| 205 |
+
b1_ln2_w 143708160 4096 float32 1024
|
| 206 |
+
b1_ls1 143712256 4096 float32 1024
|
| 207 |
+
b1_ls2 143716352 4096 float32 1024
|
| 208 |
+
b1_o 143720448 1048576 uint8 1024x1024
|
| 209 |
+
b1_o_b 144769024 4096 float32 1024
|
| 210 |
+
b1_o_s 144773120 4096 float32 1024x1
|
| 211 |
+
b1_qkv 144777216 3145728 uint8 3072x1024
|
| 212 |
+
b1_qkv_b 147922944 12288 float32 3072
|
| 213 |
+
b1_qkv_s 147935232 12288 float32 3072x1
|
| 214 |
+
b1_up 147947520 4194304 uint8 4096x1024
|
| 215 |
+
b1_up_b 152141824 16384 float32 4096
|
| 216 |
+
b1_up_s 152158208 16384 float32 4096x1
|
| 217 |
+
b20_down 152174592 4194304 uint8 1024x4096
|
| 218 |
+
b20_down_b 156368896 4096 float32 1024
|
| 219 |
+
b20_down_s 156372992 4096 float32 1024x1
|
| 220 |
+
b20_ln1_b 156377088 4096 float32 1024
|
| 221 |
+
b20_ln1_w 156381184 4096 float32 1024
|
| 222 |
+
b20_ln2_b 156385280 4096 float32 1024
|
| 223 |
+
b20_ln2_w 156389376 4096 float32 1024
|
| 224 |
+
b20_ls1 156393472 4096 float32 1024
|
| 225 |
+
b20_ls2 156397568 4096 float32 1024
|
| 226 |
+
b20_o 156401664 1048576 uint8 1024x1024
|
| 227 |
+
b20_o_b 157450240 4096 float32 1024
|
| 228 |
+
b20_o_s 157454336 4096 float32 1024x1
|
| 229 |
+
b20_qkv 157458432 3145728 uint8 3072x1024
|
| 230 |
+
b20_qkv_b 160604160 12288 float32 3072
|
| 231 |
+
b20_qkv_s 160616448 12288 float32 3072x1
|
| 232 |
+
b20_up 160628736 4194304 uint8 4096x1024
|
| 233 |
+
b20_up_b 164823040 16384 float32 4096
|
| 234 |
+
b20_up_s 164839424 16384 float32 4096x1
|
| 235 |
+
b21_down 164855808 4194304 uint8 1024x4096
|
| 236 |
+
b21_down_b 169050112 4096 float32 1024
|
| 237 |
+
b21_down_s 169054208 4096 float32 1024x1
|
| 238 |
+
b21_ln1_b 169058304 4096 float32 1024
|
| 239 |
+
b21_ln1_w 169062400 4096 float32 1024
|
| 240 |
+
b21_ln2_b 169066496 4096 float32 1024
|
| 241 |
+
b21_ln2_w 169070592 4096 float32 1024
|
| 242 |
+
b21_ls1 169074688 4096 float32 1024
|
| 243 |
+
b21_ls2 169078784 4096 float32 1024
|
| 244 |
+
b21_o 169082880 1048576 uint8 1024x1024
|
| 245 |
+
b21_o_b 170131456 4096 float32 1024
|
| 246 |
+
b21_o_s 170135552 4096 float32 1024x1
|
| 247 |
+
b21_qkv 170139648 3145728 uint8 3072x1024
|
| 248 |
+
b21_qkv_b 173285376 12288 float32 3072
|
| 249 |
+
b21_qkv_s 173297664 12288 float32 3072x1
|
| 250 |
+
b21_up 173309952 4194304 uint8 4096x1024
|
| 251 |
+
b21_up_b 177504256 16384 float32 4096
|
| 252 |
+
b21_up_s 177520640 16384 float32 4096x1
|
| 253 |
+
b22_down 177537024 4194304 uint8 1024x4096
|
| 254 |
+
b22_down_b 181731328 4096 float32 1024
|
| 255 |
+
b22_down_s 181735424 4096 float32 1024x1
|
| 256 |
+
b22_ln1_b 181739520 4096 float32 1024
|
| 257 |
+
b22_ln1_w 181743616 4096 float32 1024
|
| 258 |
+
b22_ln2_b 181747712 4096 float32 1024
|
| 259 |
+
b22_ln2_w 181751808 4096 float32 1024
|
| 260 |
+
b22_ls1 181755904 4096 float32 1024
|
| 261 |
+
b22_ls2 181760000 4096 float32 1024
|
| 262 |
+
b22_o 181764096 1048576 uint8 1024x1024
|
| 263 |
+
b22_o_b 182812672 4096 float32 1024
|
| 264 |
+
b22_o_s 182816768 4096 float32 1024x1
|
| 265 |
+
b22_qkv 182820864 3145728 uint8 3072x1024
|
| 266 |
+
b22_qkv_b 185966592 12288 float32 3072
|
| 267 |
+
b22_qkv_s 185978880 12288 float32 3072x1
|
| 268 |
+
b22_up 185991168 4194304 uint8 4096x1024
|
| 269 |
+
b22_up_b 190185472 16384 float32 4096
|
| 270 |
+
b22_up_s 190201856 16384 float32 4096x1
|
| 271 |
+
b23_down 190218240 4194304 uint8 1024x4096
|
| 272 |
+
b23_down_b 194412544 4096 float32 1024
|
| 273 |
+
b23_down_s 194416640 4096 float32 1024x1
|
| 274 |
+
b23_ln1_b 194420736 4096 float32 1024
|
| 275 |
+
b23_ln1_w 194424832 4096 float32 1024
|
| 276 |
+
b23_ln2_b 194428928 4096 float32 1024
|
| 277 |
+
b23_ln2_w 194433024 4096 float32 1024
|
| 278 |
+
b23_ls1 194437120 4096 float32 1024
|
| 279 |
+
b23_ls2 194441216 4096 float32 1024
|
| 280 |
+
b23_o 194445312 1048576 uint8 1024x1024
|
| 281 |
+
b23_o_b 195493888 4096 float32 1024
|
| 282 |
+
b23_o_s 195497984 4096 float32 1024x1
|
| 283 |
+
b23_qkv 195502080 3145728 uint8 3072x1024
|
| 284 |
+
b23_qkv_b 198647808 12288 float32 3072
|
| 285 |
+
b23_qkv_s 198660096 12288 float32 3072x1
|
| 286 |
+
b23_up 198672384 4194304 uint8 4096x1024
|
| 287 |
+
b23_up_b 202866688 16384 float32 4096
|
| 288 |
+
b23_up_s 202883072 16384 float32 4096x1
|
| 289 |
+
b2_down 202899456 4194304 uint8 1024x4096
|
| 290 |
+
b2_down_b 207093760 4096 float32 1024
|
| 291 |
+
b2_down_s 207097856 4096 float32 1024x1
|
| 292 |
+
b2_ln1_b 207101952 4096 float32 1024
|
| 293 |
+
b2_ln1_w 207106048 4096 float32 1024
|
| 294 |
+
b2_ln2_b 207110144 4096 float32 1024
|
| 295 |
+
b2_ln2_w 207114240 4096 float32 1024
|
| 296 |
+
b2_ls1 207118336 4096 float32 1024
|
| 297 |
+
b2_ls2 207122432 4096 float32 1024
|
| 298 |
+
b2_o 207126528 1048576 uint8 1024x1024
|
| 299 |
+
b2_o_b 208175104 4096 float32 1024
|
| 300 |
+
b2_o_s 208179200 4096 float32 1024x1
|
| 301 |
+
b2_qkv 208183296 3145728 uint8 3072x1024
|
| 302 |
+
b2_qkv_b 211329024 12288 float32 3072
|
| 303 |
+
b2_qkv_s 211341312 12288 float32 3072x1
|
| 304 |
+
b2_up 211353600 4194304 uint8 4096x1024
|
| 305 |
+
b2_up_b 215547904 16384 float32 4096
|
| 306 |
+
b2_up_s 215564288 16384 float32 4096x1
|
| 307 |
+
b3_down 215580672 4194304 uint8 1024x4096
|
| 308 |
+
b3_down_b 219774976 4096 float32 1024
|
| 309 |
+
b3_down_s 219779072 4096 float32 1024x1
|
| 310 |
+
b3_ln1_b 219783168 4096 float32 1024
|
| 311 |
+
b3_ln1_w 219787264 4096 float32 1024
|
| 312 |
+
b3_ln2_b 219791360 4096 float32 1024
|
| 313 |
+
b3_ln2_w 219795456 4096 float32 1024
|
| 314 |
+
b3_ls1 219799552 4096 float32 1024
|
| 315 |
+
b3_ls2 219803648 4096 float32 1024
|
| 316 |
+
b3_o 219807744 1048576 uint8 1024x1024
|
| 317 |
+
b3_o_b 220856320 4096 float32 1024
|
| 318 |
+
b3_o_s 220860416 4096 float32 1024x1
|
| 319 |
+
b3_qkv 220864512 3145728 uint8 3072x1024
|
| 320 |
+
b3_qkv_b 224010240 12288 float32 3072
|
| 321 |
+
b3_qkv_s 224022528 12288 float32 3072x1
|
| 322 |
+
b3_up 224034816 4194304 uint8 4096x1024
|
| 323 |
+
b3_up_b 228229120 16384 float32 4096
|
| 324 |
+
b3_up_s 228245504 16384 float32 4096x1
|
| 325 |
+
b4_down 228261888 4194304 uint8 1024x4096
|
| 326 |
+
b4_down_b 232456192 4096 float32 1024
|
| 327 |
+
b4_down_s 232460288 4096 float32 1024x1
|
| 328 |
+
b4_ln1_b 232464384 4096 float32 1024
|
| 329 |
+
b4_ln1_w 232468480 4096 float32 1024
|
| 330 |
+
b4_ln2_b 232472576 4096 float32 1024
|
| 331 |
+
b4_ln2_w 232476672 4096 float32 1024
|
| 332 |
+
b4_ls1 232480768 4096 float32 1024
|
| 333 |
+
b4_ls2 232484864 4096 float32 1024
|
| 334 |
+
b4_o 232488960 1048576 uint8 1024x1024
|
| 335 |
+
b4_o_b 233537536 4096 float32 1024
|
| 336 |
+
b4_o_s 233541632 4096 float32 1024x1
|
| 337 |
+
b4_qkv 233545728 3145728 uint8 3072x1024
|
| 338 |
+
b4_qkv_b 236691456 12288 float32 3072
|
| 339 |
+
b4_qkv_s 236703744 12288 float32 3072x1
|
| 340 |
+
b4_up 236716032 4194304 uint8 4096x1024
|
| 341 |
+
b4_up_b 240910336 16384 float32 4096
|
| 342 |
+
b4_up_s 240926720 16384 float32 4096x1
|
| 343 |
+
b5_down 240943104 4194304 uint8 1024x4096
|
| 344 |
+
b5_down_b 245137408 4096 float32 1024
|
| 345 |
+
b5_down_s 245141504 4096 float32 1024x1
|
| 346 |
+
b5_ln1_b 245145600 4096 float32 1024
|
| 347 |
+
b5_ln1_w 245149696 4096 float32 1024
|
| 348 |
+
b5_ln2_b 245153792 4096 float32 1024
|
| 349 |
+
b5_ln2_w 245157888 4096 float32 1024
|
| 350 |
+
b5_ls1 245161984 4096 float32 1024
|
| 351 |
+
b5_ls2 245166080 4096 float32 1024
|
| 352 |
+
b5_o 245170176 1048576 uint8 1024x1024
|
| 353 |
+
b5_o_b 246218752 4096 float32 1024
|
| 354 |
+
b5_o_s 246222848 4096 float32 1024x1
|
| 355 |
+
b5_qkv 246226944 3145728 uint8 3072x1024
|
| 356 |
+
b5_qkv_b 249372672 12288 float32 3072
|
| 357 |
+
b5_qkv_s 249384960 12288 float32 3072x1
|
| 358 |
+
b5_up 249397248 4194304 uint8 4096x1024
|
| 359 |
+
b5_up_b 253591552 16384 float32 4096
|
| 360 |
+
b5_up_s 253607936 16384 float32 4096x1
|
| 361 |
+
b6_down 253624320 4194304 uint8 1024x4096
|
| 362 |
+
b6_down_b 257818624 4096 float32 1024
|
| 363 |
+
b6_down_s 257822720 4096 float32 1024x1
|
| 364 |
+
b6_ln1_b 257826816 4096 float32 1024
|
| 365 |
+
b6_ln1_w 257830912 4096 float32 1024
|
| 366 |
+
b6_ln2_b 257835008 4096 float32 1024
|
| 367 |
+
b6_ln2_w 257839104 4096 float32 1024
|
| 368 |
+
b6_ls1 257843200 4096 float32 1024
|
| 369 |
+
b6_ls2 257847296 4096 float32 1024
|
| 370 |
+
b6_o 257851392 1048576 uint8 1024x1024
|
| 371 |
+
b6_o_b 258899968 4096 float32 1024
|
| 372 |
+
b6_o_s 258904064 4096 float32 1024x1
|
| 373 |
+
b6_qkv 258908160 3145728 uint8 3072x1024
|
| 374 |
+
b6_qkv_b 262053888 12288 float32 3072
|
| 375 |
+
b6_qkv_s 262066176 12288 float32 3072x1
|
| 376 |
+
b6_up 262078464 4194304 uint8 4096x1024
|
| 377 |
+
b6_up_b 266272768 16384 float32 4096
|
| 378 |
+
b6_up_s 266289152 16384 float32 4096x1
|
| 379 |
+
b7_down 266305536 4194304 uint8 1024x4096
|
| 380 |
+
b7_down_b 270499840 4096 float32 1024
|
| 381 |
+
b7_down_s 270503936 4096 float32 1024x1
|
| 382 |
+
b7_ln1_b 270508032 4096 float32 1024
|
| 383 |
+
b7_ln1_w 270512128 4096 float32 1024
|
| 384 |
+
b7_ln2_b 270516224 4096 float32 1024
|
| 385 |
+
b7_ln2_w 270520320 4096 float32 1024
|
| 386 |
+
b7_ls1 270524416 4096 float32 1024
|
| 387 |
+
b7_ls2 270528512 4096 float32 1024
|
| 388 |
+
b7_o 270532608 1048576 uint8 1024x1024
|
| 389 |
+
b7_o_b 271581184 4096 float32 1024
|
| 390 |
+
b7_o_s 271585280 4096 float32 1024x1
|
| 391 |
+
b7_qkv 271589376 3145728 uint8 3072x1024
|
| 392 |
+
b7_qkv_b 274735104 12288 float32 3072
|
| 393 |
+
b7_qkv_s 274747392 12288 float32 3072x1
|
| 394 |
+
b7_up 274759680 4194304 uint8 4096x1024
|
| 395 |
+
b7_up_b 278953984 16384 float32 4096
|
| 396 |
+
b7_up_s 278970368 16384 float32 4096x1
|
| 397 |
+
b8_down 278986752 4194304 uint8 1024x4096
|
| 398 |
+
b8_down_b 283181056 4096 float32 1024
|
| 399 |
+
b8_down_s 283185152 4096 float32 1024x1
|
| 400 |
+
b8_ln1_b 283189248 4096 float32 1024
|
| 401 |
+
b8_ln1_w 283193344 4096 float32 1024
|
| 402 |
+
b8_ln2_b 283197440 4096 float32 1024
|
| 403 |
+
b8_ln2_w 283201536 4096 float32 1024
|
| 404 |
+
b8_ls1 283205632 4096 float32 1024
|
| 405 |
+
b8_ls2 283209728 4096 float32 1024
|
| 406 |
+
b8_o 283213824 1048576 uint8 1024x1024
|
| 407 |
+
b8_o_b 284262400 4096 float32 1024
|
| 408 |
+
b8_o_s 284266496 4096 float32 1024x1
|
| 409 |
+
b8_qkv 284270592 3145728 uint8 3072x1024
|
| 410 |
+
b8_qkv_b 287416320 12288 float32 3072
|
| 411 |
+
b8_qkv_s 287428608 12288 float32 3072x1
|
| 412 |
+
b8_up 287440896 4194304 uint8 4096x1024
|
| 413 |
+
b8_up_b 291635200 16384 float32 4096
|
| 414 |
+
b8_up_s 291651584 16384 float32 4096x1
|
| 415 |
+
b9_down 291667968 4194304 uint8 1024x4096
|
| 416 |
+
b9_down_b 295862272 4096 float32 1024
|
| 417 |
+
b9_down_s 295866368 4096 float32 1024x1
|
| 418 |
+
b9_ln1_b 295870464 4096 float32 1024
|
| 419 |
+
b9_ln1_w 295874560 4096 float32 1024
|
| 420 |
+
b9_ln2_b 295878656 4096 float32 1024
|
| 421 |
+
b9_ln2_w 295882752 4096 float32 1024
|
| 422 |
+
b9_ls1 295886848 4096 float32 1024
|
| 423 |
+
b9_ls2 295890944 4096 float32 1024
|
| 424 |
+
b9_o 295895040 1048576 uint8 1024x1024
|
| 425 |
+
b9_o_b 296943616 4096 float32 1024
|
| 426 |
+
b9_o_s 296947712 4096 float32 1024x1
|
| 427 |
+
b9_qkv 296951808 3145728 uint8 3072x1024
|
| 428 |
+
b9_qkv_b 300097536 12288 float32 3072
|
| 429 |
+
b9_qkv_s 300109824 12288 float32 3072x1
|
| 430 |
+
b9_up 300122112 4194304 uint8 4096x1024
|
| 431 |
+
b9_up_b 304316416 16384 float32 4096
|
| 432 |
+
b9_up_s 304332800 16384 float32 4096x1
|
| 433 |
+
cls 304349184 2048 uint16 1x1024
|
| 434 |
+
key_mask 304351232 1280 uint16 5x128
|
| 435 |
+
norm_b 304352512 4096 float32 1024
|
| 436 |
+
norm_w 304356608 4096 float32 1024
|
| 437 |
+
patch_b 304360704 4096 float32 1024
|
| 438 |
+
patch_w 304364800 1572864 uint16 1024x768
|
| 439 |
+
pos 305937664 1310720 uint16 640x1024
|
models/fp8vit/vit_embed.axmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c3e584bce4ed4fb44f648ae94e013c84105d077327d57bd05e31f3282abd962a
|
| 3 |
+
size 55257
|
models/fp8vit/vit_final_ln.axmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7cd3cdadfc5eaa99789598003a461555e415fe999e4a86ba168e0f50d0941642
|
| 3 |
+
size 29103
|
models/fp8vit/vit_layer.axmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e15bad640fb6a30891a20844711ed8e39b5afc197bda5845822897b29dcabbd0
|
| 3 |
+
size 355029
|
models/h4_wb.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a41618844b2015d097b1bf2ada0cae5fe2fb47947cf10565d1bd5e16d919ae2e
|
| 3 |
+
size 4128
|
models/sharp_tail.axmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b5e6a3942763354b44e5742e03c5cba56687257affe28b38f927ee1064f0331
|
| 3 |
+
size 94658901
|
python/sharp_ax.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""SHARP (apple/ml-sharp) single image -> 3D Gaussian Splatting on AX8860: Python binding of libsharp_ax.so (ctypes).
|
| 2 |
+
|
| 3 |
+
from sharp_ax import Sharp
|
| 4 |
+
with Sharp("models") as s: # loads the models once
|
| 5 |
+
t = s.run("photo.jpg", "out.spz") # .spz = SPZ v2 (~1/4 size), anything else = PLY
|
| 6 |
+
print(t["total_ms"], t["gaussians"])
|
| 7 |
+
"""
|
| 8 |
+
import ctypes
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
+
__all__ = ["Sharp", "SharpError"]
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class SharpError(RuntimeError):
|
| 15 |
+
pass
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class _Timing(ctypes.Structure):
|
| 19 |
+
_fields_ = [("load_ms", ctypes.c_double), ("decode_ms", ctypes.c_double), ("preprocess_ms", ctypes.c_double),
|
| 20 |
+
("vit_ms", ctypes.c_double), ("tail_ms", ctypes.c_double), ("h4_ms", ctypes.c_double),
|
| 21 |
+
("post_ms", ctypes.c_double), ("write_ms", ctypes.c_double), ("total_ms", ctypes.c_double),
|
| 22 |
+
("width", ctypes.c_int), ("height", ctypes.c_int), ("f_px", ctypes.c_double),
|
| 23 |
+
("gaussians", ctypes.c_ulonglong), ("hw_jpeg", ctypes.c_int)]
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _load_lib(path=None):
|
| 27 |
+
here = os.path.dirname(os.path.abspath(__file__))
|
| 28 |
+
cands = [path] if path else [os.environ.get("SHARP_AX_LIB"), os.path.join(here, "libsharp_ax.so"), "libsharp_ax.so"]
|
| 29 |
+
err = None
|
| 30 |
+
for p in cands:
|
| 31 |
+
if not p:
|
| 32 |
+
continue
|
| 33 |
+
try:
|
| 34 |
+
lib = ctypes.CDLL(p)
|
| 35 |
+
break
|
| 36 |
+
except OSError as e:
|
| 37 |
+
err = e
|
| 38 |
+
else:
|
| 39 |
+
raise SharpError(f"cannot load libsharp_ax.so ({err}); set SHARP_AX_LIB or put it next to sharp_ax.py")
|
| 40 |
+
lib.sharp_create.restype = ctypes.c_void_p
|
| 41 |
+
lib.sharp_create.argtypes = [ctypes.c_char_p, ctypes.c_int]
|
| 42 |
+
lib.sharp_run.restype = ctypes.c_int
|
| 43 |
+
lib.sharp_run.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t, ctypes.c_char_p, ctypes.c_double, ctypes.c_double,
|
| 44 |
+
ctypes.POINTER(_Timing)]
|
| 45 |
+
lib.sharp_destroy.restype = None
|
| 46 |
+
lib.sharp_destroy.argtypes = [ctypes.c_void_p]
|
| 47 |
+
lib.sharp_last_error.restype = ctypes.c_char_p
|
| 48 |
+
return lib
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
class Sharp:
|
| 52 |
+
"""One instance = models loaded once on the NPU. run() is not thread-safe; serialise calls."""
|
| 53 |
+
|
| 54 |
+
def __init__(self, model_dir, threads=0, lib_path=None):
|
| 55 |
+
self._ctx = None
|
| 56 |
+
self._lib = _load_lib(lib_path)
|
| 57 |
+
self._ctx = self._lib.sharp_create(os.fsencode(model_dir), int(threads))
|
| 58 |
+
if not self._ctx:
|
| 59 |
+
raise SharpError(self._lib.sharp_last_error().decode(errors="replace"))
|
| 60 |
+
|
| 61 |
+
def run(self, image, out_path, f35=30.0, fpx=0.0):
|
| 62 |
+
"""image: path or encoded bytes (JPEG uses the hardware decoder). Returns a dict of timings (ms) and info."""
|
| 63 |
+
if not self._ctx:
|
| 64 |
+
raise SharpError("closed")
|
| 65 |
+
if isinstance(image, (bytes, bytearray)):
|
| 66 |
+
data = bytes(image)
|
| 67 |
+
else:
|
| 68 |
+
with open(image, "rb") as f:
|
| 69 |
+
data = f.read()
|
| 70 |
+
t = _Timing()
|
| 71 |
+
r = self._lib.sharp_run(self._ctx, data, len(data), os.fsencode(out_path), float(f35), float(fpx), ctypes.byref(t))
|
| 72 |
+
if r != 0:
|
| 73 |
+
raise SharpError(self._lib.sharp_last_error().decode(errors="replace"))
|
| 74 |
+
return {k: getattr(t, k) for k, _ in _Timing._fields_}
|
| 75 |
+
|
| 76 |
+
def close(self):
|
| 77 |
+
if self._ctx:
|
| 78 |
+
self._lib.sharp_destroy(self._ctx)
|
| 79 |
+
self._ctx = None
|
| 80 |
+
|
| 81 |
+
def __enter__(self):
|
| 82 |
+
return self
|
| 83 |
+
|
| 84 |
+
def __exit__(self, *a):
|
| 85 |
+
self.close()
|
| 86 |
+
|
| 87 |
+
def __del__(self):
|
| 88 |
+
try:
|
| 89 |
+
self.close()
|
| 90 |
+
except Exception:
|
| 91 |
+
pass
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
if __name__ == "__main__":
|
| 95 |
+
import argparse
|
| 96 |
+
import json
|
| 97 |
+
ap = argparse.ArgumentParser(description="SHARP single image -> 3DGS on AX8860")
|
| 98 |
+
ap.add_argument("-m", "--model-dir", required=True)
|
| 99 |
+
ap.add_argument("-i", "--image", required=True)
|
| 100 |
+
ap.add_argument("-o", "--output", required=True, help=".spz or .ply")
|
| 101 |
+
ap.add_argument("--f35", type=float, default=30.0, help="35mm-equivalent focal length")
|
| 102 |
+
ap.add_argument("--fpx", type=float, default=0.0, help="focal length in pixels (overrides --f35)")
|
| 103 |
+
a = ap.parse_args()
|
| 104 |
+
with Sharp(a.model_dir) as s:
|
| 105 |
+
print(json.dumps(s.run(a.image, a.output, a.f35, a.fpx), indent=1))
|
python/web_demo.html
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="zh"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
| 3 |
+
<title>SHARP AX8860</title>
|
| 4 |
+
<style>
|
| 5 |
+
html,body{margin:0;height:100%;background:#111;color:#ddd;font:14px system-ui,sans-serif}
|
| 6 |
+
#bar{position:fixed;top:0;left:0;right:0;z-index:10;padding:8px 12px;background:rgba(0,0,0,.65);display:flex;gap:10px;align-items:center;flex-wrap:wrap}
|
| 7 |
+
select,button,input,label.btn{background:#222;color:#ddd;border:1px solid #444;padding:5px 10px;border-radius:4px;font:inherit}
|
| 8 |
+
label.btn{background:#2d5a8a;border-color:#3d7ab8;color:#fff;cursor:pointer}
|
| 9 |
+
input[type=number]{width:4.5em}
|
| 10 |
+
#msg{opacity:.85}
|
| 11 |
+
#side{position:fixed;right:10px;bottom:10px;z-index:10;background:rgba(0,0,0,.65);padding:8px 10px;border-radius:6px;max-width:320px;font-size:12px;line-height:1.6}
|
| 12 |
+
#side a{color:#8bf}
|
| 13 |
+
#drop{position:fixed;inset:0;z-index:20;background:rgba(45,90,138,.35);border:3px dashed #8bf;display:none;align-items:center;justify-content:center;font-size:24px;color:#fff}
|
| 14 |
+
@media (max-width:600px){#side{left:10px;right:10px;max-width:none}}
|
| 15 |
+
</style>
|
| 16 |
+
<script type="importmap">{"imports":{"three":"https://unpkg.com/three@0.160.0/build/three.module.js","@mkkellogg/gaussian-splats-3d":"https://unpkg.com/@mkkellogg/gaussian-splats-3d@0.4.7/build/gaussian-splats-3d.module.js"}}</script>
|
| 17 |
+
</head><body>
|
| 18 |
+
<div id="bar"><b>SHARP · AX8860</b>
|
| 19 |
+
<label class="btn">Upload / 上传图片<input id="file" type="file" accept="image/*" hidden></label>
|
| 20 |
+
<label>f35 <input id="f35" type="number" value="30" min="10" max="200" step="1"> mm</label>
|
| 21 |
+
<select id="sel"></select><button id="wob">wobble: on</button>
|
| 22 |
+
<span id="msg">Upload a photo (or drop it here). Left drag: rotate · right drag: pan · wheel: zoom</span></div>
|
| 23 |
+
<div id="side"></div><div id="drop">drop to upload</div>
|
| 24 |
+
<script type="module">
|
| 25 |
+
import * as GS from "@mkkellogg/gaussian-splats-3d";
|
| 26 |
+
const $ = id => document.getElementById(id), msg = t => $("msg").textContent = t;
|
| 27 |
+
const sel = $("sel"); let meta = {};
|
| 28 |
+
async function refresh(pick) {
|
| 29 |
+
const hist = await (await fetch("api/history")).json();
|
| 30 |
+
sel.innerHTML = ""; meta = {};
|
| 31 |
+
for (const h of hist) { meta[h.url] = h; sel.add(new Option(`${h.id.slice(9, 15)} ${h.name}`.slice(0, 40), h.url)); }
|
| 32 |
+
if (pick) sel.value = pick;
|
| 33 |
+
}
|
| 34 |
+
function side(u) {
|
| 35 |
+
const h = meta[u]; if (!h) { $("side").innerHTML = ""; return; }
|
| 36 |
+
$("side").innerHTML = `<b>${h.name}</b> ${h.width}×${h.height}<br>` +
|
| 37 |
+
`end-to-end <b>${Math.round(h.total_ms)} ms</b> (decode ${Math.round(h.decode_ms)} · preprocess ${Math.round(h.preprocess_ms)} · ` +
|
| 38 |
+
`ViT ${Math.round(h.vit_ms)} · tail ${Math.round(h.tail_ms)} · h4 ${Math.round(h.h4_ms)} · post ${Math.round(h.post_ms)} · write ${Math.round(h.write_ms)})<br>` +
|
| 39 |
+
`${h.gaussians.toLocaleString()} gaussians · <a href="${u}" download="${h.id}.spz">download SPZ</a> (${(h.size / 1e6).toFixed(1)} MB)`;
|
| 40 |
+
}
|
| 41 |
+
let viewer = null, wobble = true, t0 = performance.now(), gen = 0;
|
| 42 |
+
$("wob").onclick = e => { wobble = !wobble; e.target.textContent = "wobble: " + (wobble ? "on" : "off"); };
|
| 43 |
+
async function load(u) {
|
| 44 |
+
const my = ++gen; side(u); msg("loading …");
|
| 45 |
+
if (viewer) { try { await viewer.dispose(); } catch (e) {} document.querySelectorAll("canvas").forEach(c => c.remove()); viewer = null; }
|
| 46 |
+
// SHARP 输出是 OpenCV 坐标 (x 右, y 下, z 前), 相机在原点朝 +z
|
| 47 |
+
const v = new GS.Viewer({ cameraUp: [0, -1, 0], initialCameraPosition: [0, 0, 0], initialCameraLookAt: [0, 0, 20],
|
| 48 |
+
sharedMemoryForWorkers: false, sphericalHarmonicsDegree: 0 });
|
| 49 |
+
viewer = v;
|
| 50 |
+
await v.addSplatScene(u, { showLoadingUI: true, progressiveLoad: false, format: GS.SceneFormat.Spz });
|
| 51 |
+
if (my !== gen) return;
|
| 52 |
+
v.start();
|
| 53 |
+
const cam = v.camera, ctl = v.controls; ctl.target.set(0, 0, 20); ctl.update();
|
| 54 |
+
const base = cam.position.clone();
|
| 55 |
+
(function tick() { if (my !== gen) return;
|
| 56 |
+
if (wobble) { const t = (performance.now() - t0) / 1000;
|
| 57 |
+
cam.position.set(base.x + 0.25 * Math.sin(t * 0.8), base.y + 0.08 * Math.sin(t * 1.6), base.z); ctl.update(); }
|
| 58 |
+
requestAnimationFrame(tick); })();
|
| 59 |
+
msg("left drag: rotate · right drag: pan · wheel: zoom (limited view range, large rotations show holes)");
|
| 60 |
+
}
|
| 61 |
+
sel.onchange = () => load(sel.value);
|
| 62 |
+
// 浏览器端预处理: 按 EXIF 转正, 长边 <= 4096, 宽高取偶数, 转 JPEG (板上用硬件 JPEG 解码)
|
| 63 |
+
async function toJpeg(file) {
|
| 64 |
+
const bmp = await createImageBitmap(file, { imageOrientation: "from-image" });
|
| 65 |
+
const s = Math.min(1, 4096 / Math.max(bmp.width, bmp.height));
|
| 66 |
+
const w = Math.max(2, Math.round(bmp.width * s / 2) * 2), h = Math.max(2, Math.round(bmp.height * s / 2) * 2);
|
| 67 |
+
const c = document.createElement("canvas"); c.width = w; c.height = h;
|
| 68 |
+
c.getContext("2d").drawImage(bmp, 0, 0, w, h);
|
| 69 |
+
return await new Promise(r => c.toBlob(r, "image/jpeg", 0.95));
|
| 70 |
+
}
|
| 71 |
+
async function upload(file) {
|
| 72 |
+
if (!file) return;
|
| 73 |
+
try {
|
| 74 |
+
msg("preparing " + file.name + " …");
|
| 75 |
+
const jpg = await toJpeg(file);
|
| 76 |
+
msg("running on the NPU …"); const t1 = performance.now();
|
| 77 |
+
const r = await fetch("api/run", { method: "POST", body: jpg, headers: { "X-Name": encodeURIComponent(file.name).slice(0, 120), "X-F35": $("f35").value } });
|
| 78 |
+
const j = await r.json();
|
| 79 |
+
if (j.error) { msg("✗ " + j.error); return; }
|
| 80 |
+
msg(`done in ${((performance.now() - t1) / 1000).toFixed(1)} s, loading …`);
|
| 81 |
+
await refresh(j.url); load(j.url);
|
| 82 |
+
} catch (e) { msg("✗ " + e); }
|
| 83 |
+
}
|
| 84 |
+
$("file").onchange = e => upload(e.target.files[0]);
|
| 85 |
+
addEventListener("dragover", e => { e.preventDefault(); $("drop").style.display = "flex"; });
|
| 86 |
+
$("drop").addEventListener("dragleave", () => $("drop").style.display = "none");
|
| 87 |
+
addEventListener("drop", e => { e.preventDefault(); $("drop").style.display = "none"; upload(e.dataTransfer.files[0]); });
|
| 88 |
+
await refresh();
|
| 89 |
+
if (sel.value) load(sel.value);
|
| 90 |
+
</script></body></html>
|
python/web_demo.py
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Web demo running on the AX8860 board: upload a photo in the browser -> SHARP on the NPU -> view the 3D Gaussians.
|
| 2 |
+
|
| 3 |
+
python3 web_demo.py -m ../models --port 8080 # then open http://<board-ip>:8080
|
| 4 |
+
|
| 5 |
+
Only the Python standard library is needed (plus libsharp_ax.so). The browser rotates the photo by its EXIF orientation,
|
| 6 |
+
limits the long side to 4096 and re-encodes it as JPEG, so the board can use its hardware JPEG decoder.
|
| 7 |
+
Results (SPZ) are kept in --out-dir; models are loaded once at start-up.
|
| 8 |
+
"""
|
| 9 |
+
import argparse
|
| 10 |
+
import json
|
| 11 |
+
import os
|
| 12 |
+
import re
|
| 13 |
+
import threading
|
| 14 |
+
import time
|
| 15 |
+
import urllib.parse
|
| 16 |
+
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
| 17 |
+
|
| 18 |
+
from sharp_ax import Sharp, SharpError
|
| 19 |
+
|
| 20 |
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def main():
|
| 24 |
+
ap = argparse.ArgumentParser(description="SHARP AX8860 web demo")
|
| 25 |
+
ap.add_argument("-m", "--model-dir", required=True)
|
| 26 |
+
ap.add_argument("--host", default="0.0.0.0")
|
| 27 |
+
ap.add_argument("--port", type=int, default=8080)
|
| 28 |
+
ap.add_argument("--out-dir", default=os.path.join(HERE, "results"))
|
| 29 |
+
ap.add_argument("--keep", type=int, default=20, help="number of results to keep on disk")
|
| 30 |
+
ap.add_argument("--max-mb", type=float, default=40, help="upload size limit")
|
| 31 |
+
ap.add_argument("--npu-lock", default="", help="optional lock directory shared with other NPU jobs on the board "
|
| 32 |
+
"(taken with mkdir for each inference; busy -> HTTP 429)")
|
| 33 |
+
a = ap.parse_args()
|
| 34 |
+
os.makedirs(a.out_dir, exist_ok=True)
|
| 35 |
+
|
| 36 |
+
print("loading models ...", flush=True)
|
| 37 |
+
sharp = Sharp(a.model_dir)
|
| 38 |
+
lock = threading.Lock() # one inference at a time
|
| 39 |
+
|
| 40 |
+
def npu_lock_take():
|
| 41 |
+
if not a.npu_lock:
|
| 42 |
+
return True
|
| 43 |
+
try:
|
| 44 |
+
os.mkdir(a.npu_lock)
|
| 45 |
+
except FileExistsError:
|
| 46 |
+
return False
|
| 47 |
+
with open(os.path.join(a.npu_lock, "owner"), "w") as f:
|
| 48 |
+
with open("/proc/uptime") as u:
|
| 49 |
+
f.write(f"sharp_web {os.getpid()} {u.read().split('.')[0]}\n")
|
| 50 |
+
return True
|
| 51 |
+
|
| 52 |
+
def npu_lock_release():
|
| 53 |
+
if a.npu_lock:
|
| 54 |
+
try:
|
| 55 |
+
os.remove(os.path.join(a.npu_lock, "owner"))
|
| 56 |
+
os.rmdir(a.npu_lock)
|
| 57 |
+
except OSError:
|
| 58 |
+
pass
|
| 59 |
+
|
| 60 |
+
def history():
|
| 61 |
+
items = []
|
| 62 |
+
for fn in os.listdir(a.out_dir):
|
| 63 |
+
if fn.endswith(".json"):
|
| 64 |
+
try:
|
| 65 |
+
with open(os.path.join(a.out_dir, fn)) as f:
|
| 66 |
+
items.append(json.load(f))
|
| 67 |
+
except (OSError, ValueError):
|
| 68 |
+
pass
|
| 69 |
+
return sorted(items, key=lambda x: -x.get("ts", 0))
|
| 70 |
+
|
| 71 |
+
def prune():
|
| 72 |
+
for old in history()[a.keep:]:
|
| 73 |
+
for ext in (".spz", ".json"):
|
| 74 |
+
try:
|
| 75 |
+
os.remove(os.path.join(a.out_dir, old["id"] + ext))
|
| 76 |
+
except OSError:
|
| 77 |
+
pass
|
| 78 |
+
|
| 79 |
+
class Handler(SimpleHTTPRequestHandler):
|
| 80 |
+
def __init__(self, *args, **kw):
|
| 81 |
+
super().__init__(*args, directory=HERE, **kw)
|
| 82 |
+
|
| 83 |
+
def log_message(self, *args):
|
| 84 |
+
pass
|
| 85 |
+
|
| 86 |
+
def send_json(self, obj, code=200):
|
| 87 |
+
b = json.dumps(obj, ensure_ascii=False).encode()
|
| 88 |
+
self.send_response(code)
|
| 89 |
+
self.send_header("Content-Type", "application/json; charset=utf-8")
|
| 90 |
+
self.send_header("Content-Length", str(len(b)))
|
| 91 |
+
self.end_headers()
|
| 92 |
+
self.wfile.write(b)
|
| 93 |
+
|
| 94 |
+
def do_GET(self):
|
| 95 |
+
if self.path == "/" or self.path.startswith("/?"):
|
| 96 |
+
self.path = "/web_demo.html"
|
| 97 |
+
if self.path == "/api/history":
|
| 98 |
+
return self.send_json(history())
|
| 99 |
+
if self.path.startswith("/results/"):
|
| 100 |
+
name = os.path.basename(self.path.split("?")[0])
|
| 101 |
+
p = os.path.join(a.out_dir, name)
|
| 102 |
+
if not re.fullmatch(r"[\w.-]+\.spz", name) or not os.path.isfile(p):
|
| 103 |
+
return self.send_error(404)
|
| 104 |
+
self.send_response(200)
|
| 105 |
+
self.send_header("Content-Type", "application/octet-stream")
|
| 106 |
+
self.send_header("Content-Length", str(os.path.getsize(p)))
|
| 107 |
+
self.end_headers()
|
| 108 |
+
with open(p, "rb") as f:
|
| 109 |
+
while True:
|
| 110 |
+
chunk = f.read(1 << 20)
|
| 111 |
+
if not chunk:
|
| 112 |
+
break
|
| 113 |
+
self.wfile.write(chunk)
|
| 114 |
+
return
|
| 115 |
+
if self.path not in ("/web_demo.html",):
|
| 116 |
+
return self.send_error(404)
|
| 117 |
+
return super().do_GET()
|
| 118 |
+
|
| 119 |
+
def do_POST(self):
|
| 120 |
+
if self.path != "/api/run":
|
| 121 |
+
return self.send_error(404)
|
| 122 |
+
n = int(self.headers.get("Content-Length", 0))
|
| 123 |
+
if n <= 0 or n > a.max_mb * (1 << 20):
|
| 124 |
+
return self.send_json({"error": f"image must be 1 B .. {a.max_mb:g} MB"}, 400)
|
| 125 |
+
data = self.rfile.read(n)
|
| 126 |
+
name = os.path.basename(urllib.parse.unquote(self.headers.get("X-Name", "upload")))[:80]
|
| 127 |
+
try:
|
| 128 |
+
f35 = float(self.headers.get("X-F35", "30") or 30)
|
| 129 |
+
except ValueError:
|
| 130 |
+
f35 = 30.0
|
| 131 |
+
if not lock.acquire(timeout=1):
|
| 132 |
+
return self.send_json({"error": "busy, try again in a few seconds"}, 429)
|
| 133 |
+
if not npu_lock_take():
|
| 134 |
+
lock.release()
|
| 135 |
+
return self.send_json({"error": "the NPU is used by another job, try again later"}, 429)
|
| 136 |
+
try:
|
| 137 |
+
rid = time.strftime("%Y%m%d_%H%M%S_") + os.urandom(2).hex()
|
| 138 |
+
out = os.path.join(a.out_dir, rid + ".spz")
|
| 139 |
+
t0 = time.time()
|
| 140 |
+
t = sharp.run(data, out, f35=f35)
|
| 141 |
+
rec = {"id": rid, "name": name, "ts": time.time(), "url": "results/" + rid + ".spz", "size": os.path.getsize(out),
|
| 142 |
+
"wall_ms": round((time.time() - t0) * 1000), **{k: (round(v, 1) if isinstance(v, float) else v) for k, v in t.items()}}
|
| 143 |
+
with open(os.path.join(a.out_dir, rid + ".json"), "w") as f:
|
| 144 |
+
json.dump(rec, f, ensure_ascii=False)
|
| 145 |
+
except SharpError as e:
|
| 146 |
+
return self.send_json({"error": str(e)}, 500)
|
| 147 |
+
finally:
|
| 148 |
+
npu_lock_release()
|
| 149 |
+
lock.release()
|
| 150 |
+
prune()
|
| 151 |
+
return self.send_json(rec)
|
| 152 |
+
|
| 153 |
+
srv = ThreadingHTTPServer((a.host, a.port), Handler)
|
| 154 |
+
print(f"ready: http://{a.host}:{a.port}", flush=True)
|
| 155 |
+
try:
|
| 156 |
+
srv.serve_forever()
|
| 157 |
+
finally:
|
| 158 |
+
sharp.close()
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
if __name__ == "__main__":
|
| 162 |
+
main()
|