Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A simple addition to the codebase to add graph structure logging. From the README:
GGML GRAPH LOGGING FORK OF LLAMA.CPP
This fork includes a feature to log the computation graph of the model to a CSV file.
Graph Logging
To enable graph logging, set the environment variable
GGML_LOG_GRAPHto1ortrue:export GGML_LOG_GRAPH=1By default, the graph will be written to
ggml_graph.csvin the current working directory. You can specify a different filename using theGGML_LOG_GRAPH_FILENAMEenvironment variable:export GGML_LOG_GRAPH_FILENAME=/path/to/your/graph_log.csvImportant: When graph logging is enabled, the program will terminate immediately after writing the log file.
Output Format
The output CSV file contains the following columns for each node (tensor) in the graph:
node_id: The memory address of the tensor, serving as a unique ID.name: The name assigned to the tensor (if any).op: The GGML operation that produces this tensor.dim0,dim1,dim2,dim3: The dimensions of the tensor.bytes: The size of the tensor data in bytes.flags: Tensor flags (e.g.,PARAM,INPUT,OUTPUT,LEAF).src0...srcN: Thenode_id(memory address) of the source tensors for this node, up toGGML_MAX_SRC.