Commit Graph

17 Commits

Author SHA1 Message Date
b2953f5643 [9/N] Apply ruff UP035 rule (#165515)
This is follow-up of #165214 to continue applying ruff UP035 rule to the code base.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165515
Approved by: https://github.com/Lucaskabela
2025-10-17 00:09:51 +00:00
e2f9759bd0 Fix broken URLs (#152237)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152237
Approved by: https://github.com/huydhn, https://github.com/malfet
2025-04-27 09:56:42 +00:00
07669ed960 PEP585 update - benchmarks tools torchgen (#145101)
This is one of a series of PRs to update us to PEP585 (changing Dict -> dict, List -> list, etc).  Most of the PRs were completely automated with RUFF as follows:

Since RUFF UP006 is considered an "unsafe" fix first we need to enable unsafe fixes:

```
--- a/tools/linter/adapters/ruff_linter.py
+++ b/tools/linter/adapters/ruff_linter.py
@@ -313,6 +313,7 @@
                     "ruff",
                     "check",
                     "--fix-only",
+                    "--unsafe-fixes",
                     "--exit-zero",
                     *([f"--config={config}"] if config else []),
                     "--stdin-filename",
```

Then we need to tell RUFF to allow UP006 (as a final PR once all of these have landed this will be made permanent):

```
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,7 +40,7 @@

 [tool.ruff]
-target-version = "py38"
+target-version = "py39"
 line-length = 88
 src = ["caffe2", "torch", "torchgen", "functorch", "test"]

@@ -87,7 +87,6 @@
     "SIM116", # Disable Use a dictionary instead of consecutive `if` statements
     "SIM117",
     "SIM118",
-    "UP006", # keep-runtime-typing
     "UP007", # keep-runtime-typing
 ]
 select = [
```

Finally running `lintrunner -a --take RUFF` will fix up the deprecated uses.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145101
Approved by: https://github.com/bobrenjc93
2025-01-18 05:05:07 +00:00
df136df8d5 Remove upload_test_stat_aggregates script (#139915)
Instead of moving these queries to ClickHouse, we're just going to remove it since it's not really used.  We do want something for test aggregates, but we can make a new script instead
Pull Request resolved: https://github.com/pytorch/pytorch/pull/139915
Approved by: https://github.com/huydhn
2024-11-07 20:14:12 +00:00
8a67daf283 [BE][Easy] enable postponed annotations in tools (#129375)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129375
Approved by: https://github.com/malfet
2024-06-29 09:23:35 +00:00
a32ce5ce34 Revert "[BE][Easy] enable postponed annotations in tools (#129375)"
This reverts commit 59eb2897f1745f513edb6c63065ffad481c4c8d0.

Reverted https://github.com/pytorch/pytorch/pull/129375 on behalf of https://github.com/huydhn due to Sorry for reverting your change but I need to revert to cleanly revert https://github.com/pytorch/pytorch/pull/129374, please do a rebase and reland this ([comment](https://github.com/pytorch/pytorch/pull/129375#issuecomment-2197800541))
2024-06-29 00:44:25 +00:00
59eb2897f1 [BE][Easy] enable postponed annotations in tools (#129375)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129375
Approved by: https://github.com/malfet
2024-06-28 15:37:54 +00:00
9978850cc0 Update list of bots in upload_external_contrib_stats.py (#102786)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102786
Approved by: https://github.com/PaliC
2023-06-02 18:34:22 +00:00
683753fb0f upload external pr kpi for 10 days in the past (#102780)
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 963044b</samp>

The pull request improves the reliability and completeness of the external contribution stats collection and upload. It adds a `time` delay to avoid API rate limit errors in `upload_external_contrib_stats.py`, and changes the order and date range of the commands in `nightly-rockset-uploads.yml`.
<!--
copilot:poem
-->
### <samp>🤖 Generated by Copilot at 963044b</samp>

> _Oh we are the coders of the open source sea_
> _And we pull and we push with the `git` command_
> _We upload the stats of the external PRs_
> _With a ten-day range and a `time` delay_

Pull Request resolved: https://github.com/pytorch/pytorch/pull/102780
Approved by: https://github.com/kit1980
2023-06-02 03:00:38 +00:00
b8e2e0e907 check users are actually recieved in upload to s3 (#102760)
<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 5927156</samp>

### Summary
🔁🧹📊

<!--
1.  🔁 - This emoji represents the retry logic that is added to the script, which loops until the command succeeds or reaches the maximum number of attempts.
2.  🧹 - This emoji represents the cleanup and simplification of the code, which removes clutter and makes it easier to understand and maintain.
3.  📊 - This emoji represents the data analysis and visualization that is enabled by uploading the external contribution stats to Rockset, which allows for exploring and sharing insights on the open source community.
-->
This pull request improves the `upload_external_contrib_stats.py` script and the `nightly-rockset-uploads.yml` workflow. It makes the script more efficient and robust, and increases the retry logic for the Rockset upload command.

> _Oh we are the coders of the open source sea_
> _And we upload stats to Rockset with glee_
> _But sometimes the network is slow or breaks down_
> _So we retry the command and we don't let it drown_

### Walkthrough
* Increase the number of retries for uploading external contribution stats to Rockset to avoid failures ([link](https://github.com/pytorch/pytorch/pull/102760/files?diff=unified&w=0#diff-a0d80a44a0694ddbddd6d8cf9484f5b850268a34117c8caf1fc071ad59895f9fL35-R35))
* Simplify the logic of uploading external contribution stats to Rockset by removing the loop and adding assertions and print statements ([link](https://github.com/pytorch/pytorch/pull/102760/files?diff=unified&w=0#diff-ac022823c08d71df6cc85aae7f2ca50a1ec71e5f9eb9371ac563c12cf52b750cL137-R146))
* Remove unused import of `read_from_s3` from `upload_external_contrib_stats.py` to clean up the code ([link](https://github.com/pytorch/pytorch/pull/102760/files?diff=unified&w=0#diff-ac022823c08d71df6cc85aae7f2ca50a1ec71e5f9eb9371ac563c12cf52b750cL11-R11))

Pull Request resolved: https://github.com/pytorch/pytorch/pull/102760
Approved by: https://github.com/kit1980
2023-06-01 20:53:03 +00:00
c03555a303 add retries to external contribution data upload (#100889)
Adds retries to external contribution upload as it is shown to be flaky

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 43c2602</samp>

Added a function to read data from S3 objects and used it to implement a retry mechanism and verification for uploading external contribution stats. Modified `tools/stats/upload_external_contrib_stats.py` and `tools/stats/upload_stats_lib.py`.
<!--
copilot:poem
-->
### <samp>🤖 Generated by Copilot at 43c2602</samp>

> _We'll upload the stats to the cloud, me hearties_
> _We'll use `read_from_s3` to check them all_
> _We'll retry if the connection fails, me hearties_
> _We'll log the results and have a ball_

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100889
Approved by: https://github.com/huydhn
2023-05-16 05:00:48 +00:00
0cf6e74fa9 add users to external contrib stat upload (#100403)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100403
Approved by: https://github.com/kit1980
2023-05-01 20:35:51 +00:00
0e2bde3000 Create script to upload test aggregation data (#97954)
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 79f1b37</samp>

This pull request improves the workflow and data processing for uploading contribution and testing statistics to Rockset and S3. It renames and updates a workflow file, removes unused code from a script, and adds a new script to aggregate and upload test results.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97954
Approved by: https://github.com/huydhn
2023-04-04 01:28:08 +00:00
8e5f57a2b1 add users to external contribution metrics (#97928)
:copilot summary
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97928
Approved by: https://github.com/kit1980
2023-04-03 19:52:31 +00:00
3df1a9baca Upload external contribution data to s3 (#95747)
Context: We want to create a metric panel to track external contributions to the PyTorch repo

This PR creates a daily job to track how many external contributions occurred the day before and uploads it to a s3 collection which is accessible by rockset.

`upload_external_contrib_stats.py` is a python script which grabs the neccesary stats from github and sticks them into an s3 bucket. It is used here to do daily uploads, but can generally be used for larger queries as well.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/95747
Approved by: https://github.com/huydhn, https://github.com/kit1980
2023-03-02 21:57:28 +00:00
06562529d2 Revert "Upload external contribution data to s3 (#95747)"
This reverts commit f418e1f8b63c0c15f52b373a57bfd9d65d02b172.

Reverted https://github.com/pytorch/pytorch/pull/95747 on behalf of https://github.com/clee2000 due to broke lint on master, merge base is too old, https://github.com/pytorch/pytorch/actions/runs/4315881630/jobs/7531170401 f418e1f8b6 (11721314649)
2023-03-02 17:34:14 +00:00
f418e1f8b6 Upload external contribution data to s3 (#95747)
Context: We want to create a metric panel to track external contributions to the PyTorch repo

This PR creates a daily job to track how many external contributions occurred the day before and uploads it to a s3 collection which is accessible by rockset.

`upload_external_contrib_stats.py` is a python script which grabs the neccesary stats from github and sticks them into an s3 bucket. It is used here to do daily uploads, but can generally be used for larger queries as well.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/95747
Approved by: https://github.com/huydhn, https://github.com/kit1980
2023-03-02 16:03:32 +00:00