From ee55453639ba9ac31413cf7e674faeddb653ba56 Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 15:33:39 +0800 Subject: [PATCH 1/6] docs(tutorials): update all outer links in tutorials --- examples/demo.ipynb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index 2909354..db48362 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -2537,9 +2537,9 @@ "source": [ "#### F.b.1 Customize the Hierarchical Display\n", "\n", - "> All customization fields can be found in the [`Default Configuration` section in `Cheatsheet` tab](cheatsheet.md##Default-Configuration).\n", + "> All customization fields can be found in the [`Default Configuration` section in `Cheatsheet` tab](https://docs.torchmeter.top/latest/cheatsheet/#Default-Configuration).\n", "\n", - "You can customize the display of a tree level by designating the configurations through the level index, which can be found [here](./cheatsheet.md#Tree-Level-Index).\n" + "You can customize the display of a tree level by designating the configurations through the level index, which can be found [here](https://docs.torchmeter.top/latest/cheatsheet/#Tree-Level-Index).\n" ] }, { @@ -2857,7 +2857,7 @@ "source": [ "##### F.b.2.2 Customize the style\n", "\n", - "> All customization fields can be found in the [`Customization` tab](cheatsheet.md)." + "> All customization fields can be found in the [`Cheatsheet` tab](https://docs.torchmeter.top/latest/cheatsheet/)." ] }, { @@ -3182,7 +3182,7 @@ "source": [ "###### F.b.2.3.2 Dynamic Text based on Tree Node Attributes\n", "\n", - "A tree node represents an operation in the model, the attributes of which can be found in [`Tree Node Attributes` section in `Cheatsheet` tab](cheatsheet.md#Tree-Node-Attributes)." + "A tree node represents an operation in the model, the attributes of which can be found in [`Tree Node Attributes` section](https://docs.torchmeter.top/latest/cheatsheet/#Tree-Node-Attributes)." ] }, { @@ -3315,7 +3315,7 @@ "source": [ "#### F.c.1 Customize the Column/Overall Style\n", "\n", - "> All customization fields can be found in the [`Default Configuration` section in `Cheatsheet` tab](cheatsheet.md##Default-Configuration)." + "> All customization fields can be found in the [`Default Configuration` section](https://docs.torchmeter.top/latest/cheatsheet/#Default-Configuration)." ] }, { @@ -5987,7 +5987,7 @@ "### H.e Restore Configuration\n", "\n", "> Mess up the configurations? Don't worry, we can restore them to the value in loaded file. \n", - "> If the config object is not created by loading a `yaml` file, will use the default value in [`Default Configuration`](cheatsheet.md##Default-Configuration) we've prepared for you." + "> If the config object is not created by loading a `yaml` file, will use the default value in [`Default Configuration`](https://docs.torchmeter.top/latest/cheatsheet/#Default-Configuration) we've prepared for you." ] }, { @@ -6189,12 +6189,12 @@ "### I.1 Raw Data Mode\n", "\n", "> When this mode is enabled, the statistic data will be represented in the unit at the time of statistics. \n", - "> For details, see [`Unit Explanation`](cheatsheet.md#Unit-Explanation)." + "> For details, see [`Unit Explanation`](https://docs.torchmeter.top/latest/cheatsheet/#Unit-Explanation)." ] }, { "cell_type": "code", - "execution_count": 105, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -6426,6 +6426,7 @@ "# --------------------------------------------------------------------------------\n", "# model: Instance of `torchmeter.Meter` which acts like a decorator of your model\n", "\n", + "# you can compare the result with that in `E.c.1` section\n", "tb, data = model.profile(\"param\", no_tree=True, raw_data=True)" ] }, From b468c4eb35803cf34841f81254667f1fd5ad1b9c Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 15:54:45 +0800 Subject: [PATCH 2/6] docs(conventions): update PR title convention - Add tip about PR title structure. - Fix the capitalization error in example - Emphasize the type prefix choosing and the exclamation mark's meanings --- docs/src/en/contribute/conventions.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/src/en/contribute/conventions.md b/docs/src/en/contribute/conventions.md index da4b4a6..19eb2f6 100644 --- a/docs/src/en/contribute/conventions.md +++ b/docs/src/en/contribute/conventions.md @@ -310,17 +310,19 @@ Clear commit message helps us: ### **Structure** -```title="" linenums="0" -[optional scope][optional !]: +```bash title="" linenums="0" +[optional scope][optional !]: # (1) ``` +1. Note: there is **one space** between the `:` and the subject❗️ + ??? abstract "Type Prefixes" > Most are the same as [Commit Message Type Prefixes :material-link-variant:](#Structure_1){ data-preview }, cause the PR will finally be merged as a commit. !!! danger "Limitations" - Type prefix **must be one** in the following table, otherwise the PR will be rejected! + Type prefix **must be one** in the following table, otherwise the PR will be **rejected**! | PR Type | When to Use | Example | |:----------:|:---------------------------:|:--------------------------:| @@ -359,12 +361,12 @@ Clear commit message helps us: # πŸ‘Ž Avoid fix( ): Memory leak - fix( core): memory leak + fix( core): Memory leak ``` ??? warning "Exclamation Mark (`!`, Optional)" - A `!` indicates a breaking change, which means that the PR will {++bring a major version bump++}. Therefore, please use it with caution. The PRs denoted by `!` will undergo a more rigorous review procedure. + A `!` indicates a **breaking change**, which means that the PR will {++bring a major version bump++}. Therefore, please use it ^^with caution^^. The PRs denoted by `!` will ^^undergo a more rigorous review procedure^^. ??? abstract "Subject" @@ -378,10 +380,10 @@ Clear commit message helps us: ```title="" linenums="0" # πŸ‘ Good - fix: memory leak described in #456 + fix: Memory leak described in #456 # πŸ‘Ž Avoid - fix: #456 memory leak + fix: #456 Memory leak ``` --- From bee17398d1251378b80e25b2c1fe7ebf1c2a0497 Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 17:15:58 +0800 Subject: [PATCH 3/6] docs: sync repo README changes --- README.md | 4 ++-- docs/src/en/index.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2d91ddc..4fc79b7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ - **Docs**: https://docs.torchmeter.top ([Backup link](https://torchmeter.github.io/latest) πŸ”—) -- **Intro**: Provides comprehensive measurement of Pytorch model's `Parameters`, `FLOPs/MACs`, `Memory-Cost`, `Inference-Time` and `Throughput` with highly customizable result display ✨ +- **Intro**: Provides comprehensive measurement of Pytorch model's `Parameters`, `FLOPs/MACs`, `Memory-Cost`, `Inference-Time` and `Throughput` with **highly customizable result display** ✨ ## π’œ. π»π’Ύπ‘”π’½π“π’Ύπ‘”π’½π“‰π“ˆ @@ -381,7 +381,7 @@ Before jumping in, let's ensure smooth collaboration by reviewing our πŸ“‹ [**co - `TorchMeter` is an open-source project shared by developers worldwide. We're committed to fostering a **friendly, safe, and inclusive** environment for all participants. -- The provisions stipulated in our [Code - of - Conduct file](CODE_OF_CONDUCT.md) are applicable to all community platforms, which include, but are not limited to, GitHub repositories, community forums, and similar ones. +- The provisions stipulated in our [Code-of-Conduct file](CODE_OF_CONDUCT.md) are applicable to all community platforms, which include, but are not limited to, GitHub repositories, community forums, and similar ones. ## β„±. πΏπ’Ύπ’Έπ‘’π“ƒπ“ˆπ‘’ diff --git a/docs/src/en/index.md b/docs/src/en/index.md index 42c4d0e..d590a28 100644 --- a/docs/src/en/index.md +++ b/docs/src/en/index.md @@ -133,7 +133,7 @@ hide: 2. Install locally: ```bash title="" linenums="0" - pip install torchmeter-x.x.x.whl # (1) + pip install torchmeter-x.x.x-py3-none-any.whl # (1) ``` 1. πŸ™‹β€β™‚οΈ Replace `x.x.x` with actual version @@ -342,7 +342,7 @@ Thanks again ! - `TorchMeter` is an open-source project built by developers worldwide. We're committed to fostering a **friendly, safe, and inclusive** environment for all participants. -- This code applies to all community spaces including but not limited to GitHub repositories, community forums, etc. +- The provisions stipulated in our [Code-of-Conduct file :material-link-variant:](https://github.com/TorchMeter/torchmeter/blob/master/CODE_OF_CONDUCT.md) are applicable to all community platforms, which include, but are not limited to, `GitHub` repositories, community forums, and similar ones. ## β„±. πΏπ’Ύπ’Έπ‘’π“ƒπ“ˆπ‘’ From e0471647aff9ebe5f57b70221c2665895168959a Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 17:22:10 +0800 Subject: [PATCH 4/6] docs: improve readability of contributor welcome page and repo management page - Enhance the welcoming message for contributors - Clarify the details of branch strategy in the repo management page --- docs/src/en/contribute/welcome_contributors.md | 4 +++- docs/src/en/others/management.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/src/en/contribute/welcome_contributors.md b/docs/src/en/contribute/welcome_contributors.md index 4e15a3e..cd32b6b 100644 --- a/docs/src/en/contribute/welcome_contributors.md +++ b/docs/src/en/contribute/welcome_contributors.md @@ -17,4 +17,6 @@ Whether you're: Your input is pretty valuable to our community! -Before jumping in, let's ensure smooth collaboration by reviewing these guidelines first. They'll help us keep things organized and make your contribution process as efficient as possible! \ No newline at end of file +Before jumping in, let's ensure smooth collaboration by reviewing these guidelines first πŸ‘†. + +They'll help us keep things organized and make your contribution process as efficient as possible! \ No newline at end of file diff --git a/docs/src/en/others/management.md b/docs/src/en/others/management.md index 6127994..a5ffa63 100644 --- a/docs/src/en/others/management.md +++ b/docs/src/en/others/management.md @@ -18,7 +18,7 @@ To streamline collaboration and enable rapid iteration, `torchmeter` employs a s | Branch Name | Name | Purpose | Maintainer | Contributor Permissions | |:-----------:|:-------------:|:------------:|:-----------------:|:-- -------:| | `master` | Primary Development Branch | Receives latest stable code, accepts new features, optimizations, and general bug fixes | All (with review) | **Allowed** to submit PRs | - | `vA.B.x` | Version Maintenance Branch | **Only accepts** bug fixes for this version, **no new features** | Core Team | **Forbidden** to submit PRs directly | + | `vA.B.x` | Version Maintenance Branch | **Only accepts** bug fixes for a minor version, **no new features** | Core Team | **Forbidden** to submit PRs directly | #### **:material-numeric-1-box: Master Branch** @@ -39,7 +39,7 @@ To streamline collaboration and enable rapid iteration, `torchmeter` employs a s - **Purpose**: Exclusive bugfix channel for specific releases - **Lifecycle**: 1. Created when incrementing major/minor versions - 2. Archived when superseded by newer version branch (e.g., `v1.3.x`). + 2. Archived when superseded by newer version branch (e.g., a new branch named `v1.3.x` will supersede `v1.2.x`). - **Branch Protection Rules**: Inherits `master` branch's rules [^1]: It should be noted that the `PATCH` number is represented by the letter `x`, which refers to a series of revisions to be updated in the future. From 3c236c3236c54a07b0f0bf7876fff92a56f933a3 Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 17:24:42 +0800 Subject: [PATCH 5/6] docs(cheatsheet): clarify details of tree-level-index and tree-node-attributes --- docs/src/en/cheatsheet.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/src/en/cheatsheet.md b/docs/src/en/cheatsheet.md index 8db3481..a12689f 100644 --- a/docs/src/en/cheatsheet.md +++ b/docs/src/en/cheatsheet.md @@ -29,7 +29,9 @@ hide: As the name implies, it is the hierarchical index of a operation tree. -Actually, the level index of a tree node equals to `len(tree_node.node_id.split('.'))` +Figuratively, within the model operation tree, ^^each guide line represents a level^^. The level index value commences from **0** and increments from left to right. + +Additionally, the level index at which a tree node is mounted is equal to `len(tree_node.node_id.split('.'))`. For instance, the node `(1.1.6.2) 1 BatchNorm2d` below is mounted at level 4. ```title="" linenums="0" AnyNet @@ -54,7 +56,7 @@ AnyNet ↑ ↑ ↑ ↑ -0 1 2 3 +0 1 2 3 (level index, each pointing to a guide line) ``` ### **:material-numeric-3-box: How to use the tree level index?** @@ -62,11 +64,11 @@ AnyNet A valid level index empowers you to customize the operation tree with meticulous precision. `torchmeter` regards the following value as a valid tree level index: -1. A non-negative integer (e.g. `0`, `1`, `2`, ...): The configurations under a specific index apply only to the corresponding level. -2. `default`: The configurations under this index will be applied to all undefined levels. -3. `all`: The configurations under this index will be applied to all levels. +1. **A non-negative integer (e.g. `0`, `1`, `2`, ...)**: The configurations under a specific index apply only to the corresponding level. +2. **`default`**: The configurations under this index will be applied to all undefined levels. +3. **`all`**: The configurations under this index will be applied to all levels. -Please refer to [Customize the Hierarchical Display](demo.ipynb##fb1-customize-the-hierarchical-display){ .md-button } for specific usage scenarios. +Please refer to [Customize the Hierarchical Display](https://docs.torchmeter.top/latest/demo/#fb1-customize-the-hierarchical-display){ .md-button } for specific usage scenarios. --- @@ -202,7 +204,7 @@ All the attributes that are available, as defined below, are intended to: | `operation` | `torch.nn.Module` | The underlying pytorch module | | `type` | `str` | The operation type. If the operation is a pytorch module, use the name of its class | | `name` | `str` | The module name defined in the underlying pytorch model | -| `node_id` | `str` | A globally unique module identifier,
formatted as `.`.
The index commences from `1`, cause the root is denoted as `0` | +| `node_id` | `str` | A globally unique module identifier,
formatted as `.`.
The index commences from `1`, cause the root is denoted as `0` | | `is_leaf` | `bool` | Whether the node is a leaf node (no child nodes) | | `module_repr` | `str` | The text representation of the current operation.
For non-leaf nodes, it's the ndoe type.
Conversely, it is the return of `__repr__()` method | | `parent` | `torchmeter.engine.OperationNode` | The parent node of this node. Each node has only one parent | @@ -238,7 +240,7 @@ There are four types of units in `torchmeter`, listed as follows: !!! note "" - The `raw-data` tag in the subsequent content indicates that the unit marked with this tag is used in the `raw data` mode + The `raw-data` tag in the subsequent content indicates that the unit marked with this tag is used in the [`raw data` mode :material-link-variant:](https://docs.torchmeter.top/latest/demo/#i1-raw-data-mode) === ":material-counter: Counting Units" @@ -284,7 +286,7 @@ There are four types of units in `torchmeter`, listed as follows: | unit | explanation | tag | example | |:------:|:----------------:|:----------:|:------------------------------------------------------- | | `IPS` | Input Per Second | `raw-data` | `5 IPS`: process `5` inputs per second | - | `KIPS` | $10^3$ IPS | | `5 KIPS`: process `5,000` inputs per second | - | `MIPS` | $10^6$ IPS | | `5 MIPS`: process `5,000,000` inputs per second | - | `GIPS` | $10^9$ IPS | | `5 GIPS`: process `5,000,000,000` inputs per second | - | `TIPS` | $10^{12}$ IPS | | `5 TIPS`: process `5,000,000,000,000` inputs per second | + | `KIPS` | $10^3$ `IPS` | | `5 KIPS`: process `5,000` inputs per second | + | `MIPS` | $10^6$ `IPS` | | `5 MIPS`: process `5,000,000` inputs per second | + | `GIPS` | $10^9$ `IPS` | | `5 GIPS`: process `5,000,000,000` inputs per second | + | `TIPS` | $10^{12}$ `IPS` | | `5 TIPS`: process `5,000,000,000,000` inputs per second | From c9aeaaa5f14bab3051fb21101766c1a232127318 Mon Sep 17 00:00:00 2001 From: Ahzyuan Date: Sun, 22 Jun 2025 17:46:18 +0800 Subject: [PATCH 6/6] docs: enable lazy-load for imgs in contribution guideline --- docs/src/en/contribute/discussions.md | 2 +- docs/src/en/contribute/issues.md | 4 ++-- docs/src/en/contribute/prs.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/en/contribute/discussions.md b/docs/src/en/contribute/discussions.md index 283fb8d..a8b1916 100644 --- a/docs/src/en/contribute/discussions.md +++ b/docs/src/en/contribute/discussions.md @@ -7,7 +7,7 @@ title: Discussions ???+ note
- ![TorchMeter Discussions](../assets/contribute/discussion_tab.png) + ![TorchMeter Discussions](../assets/contribute/discussion_tab.png){ loading=lazy }
[Access to `Discussions` :material-link-variant:](https://github.com/TorchMeter/torchmeter/discussions)
diff --git a/docs/src/en/contribute/issues.md b/docs/src/en/contribute/issues.md index 54e42bf..58bf0fe 100644 --- a/docs/src/en/contribute/issues.md +++ b/docs/src/en/contribute/issues.md @@ -7,7 +7,7 @@ title: Issues ???+ note
- ![TorchMeter Issues](../assets/contribute/issue_tab.png) + ![TorchMeter Issues](../assets/contribute/issue_tab.png){ loading=lazy }
[Access to `Issues` :material-link-variant:](https://github.com/TorchMeter/torchmeter/issues)
@@ -39,7 +39,7 @@ title: Issues ??? example "Illustration of filing an issue" - ![Illustration of filing an issue](../assets/contribute/create_issue_from_template.png) + ![Illustration of filing an issue](../assets/contribute/create_issue_from_template.png){ loading=lazy } - Further reading: [How maintainers manage issues :material-link-variant:](../others/management.md#Issue-Management){ data-preview } diff --git a/docs/src/en/contribute/prs.md b/docs/src/en/contribute/prs.md index 273b656..a6174db 100644 --- a/docs/src/en/contribute/prs.md +++ b/docs/src/en/contribute/prs.md @@ -7,7 +7,7 @@ title: Pull Requests (PRs) ???+ note
- ![TorchMeter Pull Requests](../assets/contribute/pr_tab.png) + ![TorchMeter Pull Requests](../assets/contribute/pr_tab.png){ loading=lazy }
[Access to `Pull Requests(PRs)` :material-link-variant:](https://github.com/TorchMeter/torchmeter/pulls)
@@ -129,7 +129,7 @@ A successful installation will display the `Git` version (e.g., `git version 2.4 ??? example "Illustration of forking torchmeter" - ![Fork TorchMeter](../assets/contribute/fork_torchmeter.png) + ![Fork TorchMeter](../assets/contribute/fork_torchmeter.png){ loading=lazy } ---