sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: optional memory leak with torch.jit.script on models with fft 
Labels: oncall: jit

### 🐛 Describe the bug

Hi,

While serving a TorchScript model, I observe that the GPU VRAM utilization is generally stable. However, there are small, seemingly random increases in memory usage. I am concerned that if the model continues to run in this manner, it may eventually result in an "out of memory" error.

My model performs various Fast Fourier Transform (FFT) operations, including irfft and rfft. I suspect that these operations might be related to the issue, potentially causing the memory to not be properly cleaned up after each inference request. Notably, the same memory utilization persists even when there are no incoming requests to the model server.

![IMG-20240605-WA0074](https://github.com/pytorch/pytorch/assets/31128845/e17cd33c-0229-418b-b419-c8fb21a5351f)


### Error logs

_No response_

### Minified repro

_No response_

### Versions

PyTorch Version: 2.1.0+cu12 (tested also with 2.3.0)
CUDA Version: 12.0
GPU: tesla-t4
Operating System: kubernetes (with official nvidia image of tritonserver on version 23.08)

i used triton to serve the model with [tritonserver image version 23.08](https://docs.nvidia.com/deeplearning/triton-inference-server/release-notes/rel-23-08.html#rel-23-08) 

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang
Repository: TypeScript
Issue: Newlines removed/incorrect code generated for `getPasteEdits`
Labels: Bug,Needs Investigation

Imagine the following file:

```ts
// comment

function f() {}
```

When I press <kbd>Ctrl</kbd>+<kbd>x</kbd> on the line containing `f`, and paste it again, what VS Code does is it creates a buffer with the following contents:

```ts
// comment

```

<details><summary>and then sends **this request for paste edits**</summary>

```json
 {
    "file": "d:\\scratch\\copypasta\\src\\file.ts",
    "pastedText": [
        "function f() {}\r\n"
    ],
    "pasteLocations": [
        {
            "start": {
                "line": 2,
                "offset": 1
            },
            "end": {
                "line": 2,
                "offset": 1
            }
        }
    ],
    "copiedFrom": {
        "file": "d:\\scratch\\copypasta\\src\\file.ts",
        "spans": [
            {
                "start": {
                    "line": 3,
                    "offset": 1
                },
                "end": {
                    "line": 3,
                    "offset": 16
                }
            }
        ]
    }
}
```

</details>

<details><summary>and receives **this response**.</summary>

```json
{
    "edits": [
        {
            "fileName": "d:/scratch/copypasta/src/file.ts",
            "textChanges": [
                {
                    "start": {
                        "line": 1,
                        "offset": 15
                    },
                    "end": {
                        "line": 1,
                        "offset": 15
                    },
                    "newText": "function f() {}\r\n"
                }
            ]
        }
    ],
    "fixId": "providePostPasteEdits"
}
```

</details>


After the paste, the file no longer contains the original contents, and instead contains invalid text.

```ts
// commentfunction f() {}


```
Repository: ant-design
Issue: Table 可横向滚动时，空状态会闪动
Labels: Inactive,unconfirmed

### Reproduction link

[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/react-zyc7fy?file=demo.tsx)

### Steps to reproduce

观察 mount 时空状态的展示

### What is expected?

空状态一开始就展示在中间

### What is actually happening?

实际上好像是一开始会出现在 scroll.x 的中间部分

| Environment | Info |
| --- | --- |
| antd | 5.18.0 |
| React | latest |
| System | mac |
| Browser | chrome |

https://github.com/ant-design/ant-design/assets/47104575/9e41a569-82da-4136-af10-6967fe745248

可以看到在视频第 5 秒处的时候 Empty 没有居中
![image](https://github.com/ant-design/ant-design/assets/47104575/c6d93075-2c4e-4db2-9f76-1844c0efabcc)

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: three.js
Issue: Please allow full testing on components by running CI/CD tests in real DOM environment and support loading assets from disk
Labels: Suggestion

### Description

Currently, when running the unit tests in the CI/CD pipeline they do not run in a real DOM environment, hence the `web only` tests could not prevent the PR merge if they would run and eventually fail. Existing `e2e` tests have a different purpose and could not be considered a replacement for `web-only` tests.

Many TODO tests were not implemented yet due to not being able to test the component without a real DOM environment. For example, `ImageLoader#load` is in TODO mode because it requires constructing an image ( `createElementNS( 'img' )` ) before doing anything else.

Another limitation is not being able to load assets from disk during testing.
This prevents `loaders` from being tested against `real assets` which can lead to regressions when modifying either existing loader logic or any core (or addon) dependency that the loader relies on.


### Solution

Run unit tests in a similar way that `e2e` test are run.
In unit-tests setup, use existing features that enables `e2e` tests (`puppeteer` & `express`).
Launch a headless browser (for CI/CD pipeline) or a headful browser locally (for convenience) and run the tests in it.
Launch express to support loading assets from disk.

I have this PR
https://github.com/mrdoob/three.js/pull/28573

### Alternatives

Other libraries could support this as well but we can leverage what we already have (`puppeteer` & `express`).

### Additional context

_No response_
Repository: pytorch
Issue: Stateless random numbers
Labels: feature,triaged,module: random

### 🚀 The feature, motivation and pitch

I basically want to have similar functions as in TensorFlow like [`tf.random.stateless_uniform`](https://www.tensorflow.org/api_docs/python/tf/random/stateless_uniform) and others. They are stateless, i.e. just dependent (deterministically) on the input args, and `seed` is an input. There are functions like `create_rng_state` to get some initial state/seed and `rng_read_and_skip` to update it. For convenience, there is a `Generator` class which wraps around those functions. But importantly, the state is explicit there, and it is just a `tf.Variable`, and you can access it, read it, modify it, save/restore it, freeze it, as you want.

`torch.Generator` is different: the state is internal (although you can also read/write it) and not just a `torch.Tensor`. This is a relevant distinction which prevents some use cases (or maybe still possible but makes them more complicated): Specifically, I want to use gradient checkpointing for things like dropout. Specifically, for `torch.nn.functional.dropout`, I want to save only the `input` and the rng state for backpropagation. I maybe already could implement that by writing a custom `dropout` `torch.autograd.Function` and saving the `rng.get_state()` output for backward, and in backward, create a new temporary `torch.Generator` and recover the state via `rng.set_state()`, and then recalculate the dropout output when needed. (That's still not exactly what I want: I want that the dropout output value is not stored at all for backprop. I'm not exactly sure how to achieve that. I just described how to recompute it easily on-the-fly.) I'm not sure how efficient this recreation of `torch.Generator` is though. I would expect this is maybe somewhat costly, and such explicit stateless random number generator functions would make this more efficient, but also more straightforward.


### Alternatives

As said, maybe I could always create a new `torch.Generator` and call `set_state` on it. But I expect that creating a new `torch.Generator` for every random number generation is probably very costly? So this is not really a solution.


### Additional context

_No response_

cc @pbelevich
Repository: stable-diffusion-webui
Issue: XYZ Plot ability to do two S/R at the same time, eg lora1/lora2 and weights
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

I would like to test a range of Loras, using a range of weights from 0-1, in a grid, but everything I've tried, doesn't work. It errors out after 1 image. Not sure if bug, or flaw-by-design, or flaw-by-oversight-but-not-really-a-bug?

EG
Along X: weights, starting 0.00 and replacing 0.1, 0.2, 0.3 ... 0.9 etc
Down Y: Replace the Lora. s/r <lora1:0.00>, <lora2:0.00>, <lora4:0.00>

I can't work out why this fails. I was fairly sure that XYZ plot executes along X horizontally first, then moves down Y before going along X again left to right. This seems to be the case from observation when testing CKPT on Y and something like lora weight on X: it loads a ckpt then runs through that row along X, then moves down Y one and loads the next ckpt.

By that logic, it should begin with <lora1:0.00>, and increment along X 0.1, 0.2, 0.3... etc
Then move down Y to replace <lora1:0.00> with <lora2:0.00>
Note the replaced lora is still 0.00, so when it comes to move across X again, it should still be replacing 0.00 with 0.1, 0.2, 0.3 etc.

But this fails.

What am I doing wrong?
Or what am I not understanding about the code?

### Proposed workflow

1. Go to XYZ Plot
2. Be able to prompt s/r along X
3. AND be able to prompt s/r down Y
Even though X will be swapping into something that Y is also swapping. Because it should have swapped Y first, THEN moves horizontally along X
Seems logical



### Additional information

Thanks
Repository: storybook
Issue: [Bug]: Component does not lose focus under specific circumstances  (vuetify)
Labels: bug,needs triage

### Describe the bug

I wrote a Storybook test to test the error validation of a v-text-field component.
Sometimes in the cicd test pipeline the test for the component fails, because the error message could not be found. That is caused by the field not losing focus and therefore not triggering the validation rule. 

I found a way to reproduce this behavior locally with the given stackblitz repo.

### Reproduction link

https://stackblitz.com/edit/github-h87sns-ftqqth?file=src%2Fcomponents%2FInput.vue,src%2Fstories%2FInput.stories.ts,package.json,src%2Fmain.ts,vite.config.ts&preset=node

### Reproduction steps

1. Download the repo, because you cannot trigger this in the browser
2. Install and start storybook (i ran it with npm instead of yarn)
3. Open the ErrorValidation test for the Input component
4. Open the Input.stories.ts file in vs code
5. Remount the component (Interaction test working)
6. Without changing anything in the stories file save it
7. Interaction Test fails

### System

```bash
System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (4) x64 AMD EPYC 7543P 32-Core Processor
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 21.7.3 - /usr/bin/node
    npm: 10.5.0 - /usr/bin/npm <----- active
    pnpm: 9.1.1 - /usr/bin/pnpm
  Browsers:
    Chrome: 125.0.6422.141
  npmPackages:
    @storybook/addon-essentials: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/addon-interactions: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/addon-links: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/blocks: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/test: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/vue3: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    @storybook/vue3-vite: ^8.2.0-alpha.5 => 8.2.0-alpha.5 
    storybook: ^8.2.0-alpha.5 => 8.2.0-alpha.5
```


### Additional context

If you have any idea how to fix this, please let me know.
Repository: pytorch
Issue: Fake tensor support of distributed ops in FX graph tracing
Labels: oncall: distributed,triaged

### 🚀 The feature, motivation and pitch

Currently, the FX graph tracing (such as the one used in `aot_module`) seems not supporting collective functions such as `allgather`.

We may face some errors like `torch._subclasses.fake_tensor.UnsupportedOperatorException: c10d._allgather_base_.default` when tracing modules containing these operators.

Repro example:

<details>

```bash
 mpiexec -N 2 python3 repro.py
```

```python3
import torch
import os
from torch._functorch.aot_autograd import aot_module


rank = int(os.environ["OMPI_COMM_WORLD_RANK"])
world_size = int(os.environ["OMPI_COMM_WORLD_SIZE"])
torch.distributed.init_process_group(
    init_method="file:///tmp/dist_init",
    rank=rank,
    world_size=world_size,
    backend="gloo",
)


class Model(torch.nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x):
        pg = torch.distributed.group.WORLD
        out = torch.empty_like(x).expand(world_size, -1).reshape(-1)
        work = pg._allgather_base(out, x)
        work.wait()
        return out


model = Model()
x = torch.rand(10)

model = aot_module(model, fw_compiler=None)

model(x)
```

</details>

Supporting the trace for these operators enables optimizing the computational graphs in DistributedDataParallel training.
In DistributedDataParallel, one of the common techniques to avoid tracing collective ops by the DDP wrapper might be

1. First wrap the model by aot_module
2. Then, wrap the model in 1 by DistributedDataParallel

However, this cannot be eliminate the errors when the original model itself contains some collective operators such as  `SyncBatchNorm`, which syncs running stats among GPUs.
To support these cases, we need the abstract implemetation of the distributed ops.

### Alternatives

Some standard idea could be adding "Meta" dispatch key for `c10d._allgather_base_` manually to support its tracing by fake tensors.

But this needs the modification of C++ source files to add abstract impl pystub.

Another temporal workaround could be defining a custom allgather via `torch.library` with `Meta` dispatcher supported.

However, in most practical cases, `c10d._allgather_base_` is implicitly called by torch internals or other frameworks (such as pytorch_lightning). In such situations, replacing the function could be difficult.

### Additional context

_No response_

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @yf225 @chauhang @d4l3k
Repository: PowerToys
Issue: MWB loosing connection repeatively
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.81.1

### Installation method

Microsoft Store

### Running as admin

No

### Area(s) with issue?

Mouse Without Borders

### Steps to reproduce

Hello,
just fresh installed latest version on my 2 computers and I'm loosing connection every few seconds . Tried to setup as a service but no change.
Firewall and AV exceptions set on both computers


Tried to change many settings , no change
Both computers run W11 with May update, on same Private Wifi.

### ✔️ Expected Behavior

No loss of connection

### ❌ Actual Behavior


[Log_2024-06-06.txt](https://github.com/user-attachments/files/15612895/Log_2024-06-06.txt)

`    06/06 11:19:57.285(44)New connection from client: [OrlithDT].
[11:19:57.2867862] [Info] SocketStuff::TcpSendData
    06/06 11:19:57.286(78)SendOrReceiveARandomDataBlockPerInitialIV: Exception writing to the socket stream: System.Net.Sockets.SocketException/Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host... (This is expected when the remote machine closes the connection during desktop switch or reconnection.)
[11:19:57.2869380] [Info] SocketStuff::TcpSend
    06/06 11:19:57.286(78)TcpSendData: The socket is no longer connected, it could have been closed by the remote host.
[11:19:57.2871352] [Info] SocketStuff::MainTCPRoutine
    06/06 11:19:57.287(78)TcpReceiveData: The socket is no longer connected, it could have been closed by the remote host.
[11:20:00.2538023] [Info] <>c__DisplayClass26_0::<TCPServerThread>b__0
    06/06 11:20:00.253(88)New connection from client: [OrlithDT].
[11:20:00.2548703] [Info] SocketStuff::TcpSendData
    06/06 11:20:00.254(77)SendOrReceiveARandomDataBlockPerInitialIV: Exception writing to the socket stream: System.Net.Sockets.SocketException/Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host... (This is expected when the remote machine closes the connection during desktop switch or reconnection.)
[11:20:00.2550538] [Info] SocketStuff::TcpSend
    06/06 11:20:00.255(77)TcpSendData: The socket is no longer connected, it could have been closed by the remote host.
[11:20:00.2552323] [Info] SocketStuff::MainTCPRoutine
    06/06 11:20:00.255(77)TcpReceiveData: The socket is no longer connected, it could have been closed by the remote host.`

### Other Software

_No response_
Repository: ollama
Issue: Add `strings` module from Go for template processing
Labels: feature request

Currently, the `TEMPLATE` parameter in the `Modelfile` is a simple Go template. For example, I can do something like this to print first 25 characters of the model's response:

```go
{{ printf "%.*s" 25 .Response }}
``` 

However, this basic processing is not usable. What I'm trying to do is to remove the BOS token from the model's output. The token is `
` and it is outputted not in every message, but at the beginning of the dialog. One possible solution is to use Go's `strings` module to strip the prefix:

```go
{{ .Response | strings.TrimPrefix 
 }}
```

but this is not supported in ollama. Can we include extra functions for template processing?
Repository: vscode
Issue: Hanged during folder rename when a file was being edited - Should show proper error message
Labels: bug,file-explorer

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.90 (latest)
- OS Version: Windows 11

Steps to Reproduce:

1. I have a folder structure A / B / c.xlsx
2. I opened folder A in VS Code
3. I started editing c.xlsx so Windows marked it as a write-protected file
4. In VS Code, I tried to rename folder B - it hanged indefinitely.

Instead of hanging, VS Code should show a useful error message so that we know what went wrong. For example, Windows File Explorer gives error "A file in this folder is open in another program". A useful error message is really required - I didn't know why rename hanged in VS Code until I came across [this older issue](https://github.com/microsoft/vscode/issues/183329).
Repository: transformers
Issue: Having a function to verify if checkpoint is valid
Labels: Feature request

### Feature request

Have a boolean function that returns true if a given checkpoint is valid and false if not

### Motivation

In case a machine can be down at any moment while training. If it saves the checkpoint when the machine goes down, last checkpoint can be corrupted. So we would like to check if the last checkpoint is valid and be deleted (or not) by the end user.

### Your contribution

I can work on this
Repository: next.js
Issue: intercepting routes return 404
Labels: bug,Parallel & Intercepting Routes

### Link to the code that reproduces this issue

https://github.com/rakhmonovbekzod/app-router

### To Reproduce


![Screenshot 2024-06-06 150407](https://github.com/vercel/next.js/assets/84036205/3d57b8a0-953a-4ee0-9f1b-bad983ce72cb)


### Current vs. Expected behavior

if I want to enter /product/cards/1 return 404

### Provide environment information

```bash
node v20.14.0
next 14.2.3
npm 10.7.0
react 18
```


### Which area(s) are affected? (Select all that apply)

Parallel & Intercepting Routes

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

_No response_
Repository: pytorch
Issue: Unable to record Memory consumption with `torch.cuda.memory._record_memory_history()`
Labels: needs reproduction,module: cuda,triaged

### 🐛 Describe the bug

I get the following issue when I want to record my memory with `torch.cuda.memory._record_memory_history()`
```
line 696, in _record_memory_history_impl
    _C._cuda_recordMemoryHistory(enabled_, record_context, record_context_cpp,
RuntimeError: low_pc_ <= addr && addr <= high_pc_ INTERNAL ASSERT FAILED at "../torch/csrc/profiler/unwind/fde.h":205, please report a bug to PyTorch. NOT IN RANGE?
```
​My environment includes 
```
torch                     2.1.0.dev20230405+cu118          pypi_0    pypi
torch-dct                 0.1.6                    pypi_0    pypi
torchaudio                2.1.0.dev20230405+cu118          pypi_0    pypi
torchmetrics              0.11.4                   pypi_0    pypi
torchvision               0.16.0.dev20230405+cu118          pypi_0    pypi
```

### Versions

Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] pytorch-ignite==0.4.12
[pip3] pytorch-lightning==2.0.2
[pip3] pytorch-triton==2.1.0+46672772b4
[pip3] torch==2.1.0.dev20230405+cu118
[pip3] torch-dct==0.1.6
[pip3] torchaudio==2.1.0.dev20230405+cu118
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.16.0.dev20230405+cu118
[conda] numpy                     1.24.1                   pypi_0    pypi
[conda] pytorch-ignite            0.4.12                   pypi_0    pypi
[conda] pytorch-lightning         2.0.2                    pypi_0    pypi
[conda] pytorch-triton            2.1.0+46672772b4          pypi_0    pypi
[conda] torch                     2.1.0.dev20230405+cu118          pypi_0    pypi
[conda] torch-dct                 0.1.6                    pypi_0    pypi
[conda] torchaudio                2.1.0.dev20230405+cu118          pypi_0    pypi
[conda] torchmetrics              0.11.4                   pypi_0    pypi
[conda] torchvision               0.16.0.dev20230405+cu118          pypi_0    pypi

cc @ptrblck @msaroufim