Comments (6)
This is complicated and can't be explained in a few sentences.
I'm sorry, I don't have the time to give support here.
from aki65.github.io.
This is complicated and can't be explained in a few sentences.
I'm sorry, I don't have the time to give support here.
Ok, thanks! What if I just simply export the katago weights as int8 in bin.gz file. Does it work for the current engine? If not, would you consider supporting it in the future, thanks!
from aki65.github.io.
This approach won't work because:
a) It would keep the original model structure, and this structure can't be accelerated on the NPU due to some limitations in NNAPI interface and driver
b) If you just replace the katago float weights by the nearest int8, the error will be huge and the network results will be unusable. You need an individually tuned mapping from float to int8 for each operation (sometimes for each channel), the quantization scale.
from aki65.github.io.
I tried to convert the quantized weights using tf.lite.converter (MLIR). What I did was I first converted the saved model to a frozen graph, and then do the quantization. Since I don't have enough sample data, I just randomly generated the representative dataset within the reasonable range to see if it would work. And the structure of the resulting tflite weights was the same as those before v1.8.2. I found that batchnorm beta was replaced by an identical convolutional layer with bias in the new version of optimized weights (after v1.8.2). Anyways, my quantized weights was able to run but the speed was kind of slow (around 10v/s) . It seems that the optimization didn't really work. So would you be willing to give some quick instructions on the quantization process (like how to generate representative datasets). And by the way. it seems that the quantized weitghts is able to run on edge tpu. Since they both have the same architecture, would the app be able run on it? Thanks. @aki65
My quantized weights:
https://drive.google.com/file/d/1nDC4OXu3nqMvJ-GrTr2xKpAvPUAAx2w8/view?usp=sharing
from aki65.github.io.
A followed up question. Do you only use python or half python half c++ to do the full inference ?
from aki65.github.io.
I just found that the concatenations in the gpools are also replaced by padding and addition. The tensordot is replaced by reshape and matmul
from aki65.github.io.
Related Issues (20)
- bug in Ko play HOT 7
- Can you help me train a katago with 2 steps in a row? HOT 1
- Engine crashes when loading 18b weights on latest 8Gen3 processor HOT 5
- Release 1.19.3 performance issues ? HOT 1
- Could the app autosave the current game when be killed? HOT 5
- 28b HOT 2
- 能否加入“死活题棋谱”功能? HOT 3
- save sgf界面的设计逻辑有问题,外加一个bug HOT 3
- 能否更新最強的權重? HOT 6
- Is there a way to resize the board and the gametrees? HOT 6
- Could there be a colered circle? HOT 2
- 經過量化的權重比原來的權重弱 HOT 3
- still confused by the move suggestion ranking HOT 1
- (Just a question) mobile phones with Dimensity Chip HOT 1
- change the rules HOT 11
- Addthenumber ofmovesdisplayforthepieceson theboard HOT 1
- 可否用动画显示分析的每一个结果 HOT 2
- set visits/move for AI? HOT 1
- Detect stones in image freeze on XiaoMI HyperOS HOT 2
- two UI suggestions HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aki65.github.io.