Comments (11)
@lutzroeder I printed the execution time of functions in dagre.js as the attachment showing, which opened a llama2 model from node 0 to node 1943. The total time of dagre layout is 37 sec, the function initOrder() took 17.6 sec and the invoking of buildLayerGraph() took 6.9 sec. So initOrder() and buildLayerGraph() are the keys of performance optimization.
For the popular large language models with number of nodes at least 1000, netron should adapt them for user to use easily and quickly. So what is the development plan in the future?
from netron.
@areschen2015 please share the model file.
from netron.
@lutzroeder here is the model file, 3x
0_llama2_70b.zip
from netron.
@areschen2015 the graph has 8000+ nodes and the graph layout would take a very long time to complete.
This is explained by the warning dialog that is shown when opening the file:
![1212](https://private-user-images.githubusercontent.com/438516/295776313-b503949d-3249-4255-a5f4-412ee6884f66.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQ0NDkxNzYsIm5iZiI6MTcxNDQ0ODg3NiwicGF0aCI6Ii80Mzg1MTYvMjk1Nzc2MzEzLWI1MDM5NDlkLTMyNDktNDI1NS1hNWY0LTQxMmVlNjg4NGY2Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNDMwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDQzMFQwMzQ3NTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZmY0MzBjNDdlYTRkMjViZDBiZjFkNWYxNzZkYTUwNTk3N2MwMDBjNDhkOTMzOGQwMDJiOGNiNTc5MGQxYjYzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.r-ijeBf19VWeWbXZ5Rdh4RQs1bxgS1gI7V4xZuE94e4)
from netron.
from netron.
Is there any solution? Or other acceleration solutions, for example, we can render one half of nodes at opening time, then render the others.
from netron.
@areschen2015 you can investigate, suggest a solution and submit a pull request that works for all file formats.
from netron.
@lutzroeder I found that the main time consumption is in dagre. layout(). Is the dagre integrated the latest version? Besides, do you consider integrating other layout algorithms, such as Sankey layout or force layout?
from netron.
@areschen2015 dagre.js
is not the latest version. The code is forked, optimized and runs faster. Experiments with other layout algorithms are welcome. Ideally submit a pull request adding to dagre.js
.
from netron.
@areschen2015 as referenced earlier, one approach is to capture a hierarchical structure when serializing the file. Given the large number of formats and serialization approaches there isn't a single answer. This would not improve the situation for large flat files that removed all hierarchies, like the one you shared. Faster graph layout algorithms cloud help. The planned work is that you are investigating and trying to come up with an implementation. Graph layout algorithms tend to be non-linear in complexity so the challenge here might be finding and implementing a different algorithm that works for these large graphs and can scale linearly. buildLayerGraph
being a bottleneck of the current implementation is well understood and quite a bit of time has been invested in making this code run fast.
from netron.
@areschen2015 Hi, I'm trying to visualize ChatGLM3 with Netron, but I don't know which model file I should drag in. The bin.index.json file couldn't generate graph with lines but simply weight modules. So I'm wondering how did you generate llama2 graph? Did you merge the files together? Looking forward for your reply :-)
from netron.
Related Issues (20)
- OpenVINO: not able to open model HOT 1
- TensorFlow Lite: Conv1D displayed as Conv2D HOT 2
- TensorFlow Lite: Array buffer allocation failed
- API Support HOT 1
- TorchScript: Unsupported 'torch.polar' expression type HOT 3
- do not upload file in chrom to netron HOT 2
- ONNX: Tensor shape is not displayed HOT 2
- TensorFlow Lite: no longer shows FlexBuffer operator attributes
- Unable to open SDXL Turbo ONNX model from Hugging Face HOT 3
- Reduce connection crossings HOT 3
- Graph scrolling by dragging scrollbars doesn't work well on Firefox HOT 1
- Python server sample exits before browser finished loading HOT 4
- Tell us about the architecture of netron. HOT 1
- CatBoost support
- TNN: weight layer does not exist in model HOT 2
- Unable to open SDXL Turbo unet model in Netron HOT 1
- File open dialog should be modal HOT 2
- Netron-Setup.exe doesn't work in windows. HOT 1
- Toggle search item types
- Python Server: context.identifier.toLowerCase is not a function
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 netron.