sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: `memory_format` argument isn't supported in torchscript for tensor.is_contiguous()
Labels: oncall: jit

### 🐛 Describe the bug

is_contiguous() doesn't accept memory_format arg when scripted

Use `tensor.is_contiguous(memory_format=torch.contiguous_format)` in a module then torchscript it

```
aten::is_contiguous(Tensor self) -> (bool):
Keyword argument memory_format unknown.
:
    return tensor.is_contiguous(memory_format=torch.contiguous_format)
```

### Versions

```
Collecting environment information...
PyTorch version: 1.10.0
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.3 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-88-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.4.120
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 470.63.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.4
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.21.3
[pip3] torch==1.10.0
[pip3] torchaudio==0.10.0
[pip3] torchvision==0.11.1
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               h2bc3f7f_2  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.3.0           h06a4308_520  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.21.3                   pypi_0    pypi
[conda] numpy-base                1.21.2           py39h79a1101_0  
[conda] pytorch                   1.10.0          py3.9_cuda11.3_cudnn8.2.0_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.10.0               py39_cu113    pytorch
[conda] torchvision               0.11.1               py39_cu113    pytorch
```
Repository: next.js
Issue: 500 Error - "static responses cannot be piped. This is a bug in Next.js"
Labels: bug

### Run `next info` (available from version 12.0.8 and up)

_No response_

### What version of Next.js are you using?

12.0.7

### What version of Node.js are you using?

14.15.0

### What browser are you using?

Chrome

### What operating system are you using?

MacOS

### How are you deploying your application?

Custom server/Other platform

### Describe the Bug

Experiencing intermittent 500s in production across all SSG pages with revalidation. When checking server logs, found this errror:
```
Error: invariant: static responses cannot be piped. This is a bug in Next.js
at RenderResult.pipe (/var/app/node_modules/next/dist/server/render-result.js:18:19)
at Object.sendRenderResult (/var/app/node_modules/next/dist/server/send-payload.js:58:22)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
```
Looking a little deeper into the render-result file it appears that the result might be an empty string.

Also the 500 errors reported from users are blank with the text "Internal Server Error" and not our custom error page.

### Expected Behavior

Expect a successfully rendered page or the custom error page.

### To Reproduce

Unfortunately, haven't been able to reproduce this issue due to it's inconsistency and can't seem to find any pattern other than all the 500s are from SSG pages.
Repository: PowerToys
Issue: Easier way to keep HDs awake
Labels: Idea-New PowerToy,Product-Awake

### Description of the new feature / enhancement

As seen in the title, this feature would be a very good addition to MS Powertoys.

Basically, it allows users to prevent a specific hard drive/SSD or multiple of them to fall into 'sleep' state. By default, windows turns off hard drives that aren't being used after a specific amount of time. This feature disables that by randomly writing a file (e.g. a text file) at specific intervals to prevent a drive from fall asleep.

### Scenario when this would be used?

preventing hard drives to fall asleep

### Supporting information

https://github.com/stsrki/KeepAliveHD
https://www.ghacks.net/2009/03/03/prevent-external-hard-drives-from-entering-sleep-mode/
Repository: godot
Issue: Single-window mode is slower to start up and shut down compared to multi-window mode
Labels: discussion,platform:linuxbsd,topic:editor,performance

### Godot version

4.0.dev (d13c3c929)

### System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

### Issue description

The editor starts and quits slightly faster when single-window mode is disabled. The project manager starts much faster when single-window mode is disabled if the *"You don't have any projects"* popup appears.

I haven't tried to reproduce this on Windows and macOS yet, so this may only apply to Linux.

Note that this issue isn't applicable to `3.x`, as it does not use DisplayServer and has no multi-window support.

#### Project manager

*One popup is always opened on startup (when there are no projects in the list).*

```yaml
❯ hyperfine -w1 -i "godot --single-window --quit" "godot --quit"                
Benchmark #1: godot --single-window --quit
  Time (mean ± σ):      1.611 s ±  0.044 s    [User: 457.3 ms, System: 136.2 ms]
  Range (min … max):    1.521 s …  1.653 s    10 runs
 
Benchmark #2: godot --quit
  Time (mean ± σ):     662.3 ms ±   9.5 ms    [User: 449.2 ms, System: 141.1 ms]
  Range (min … max):   655.8 ms … 687.7 ms    10 runs
 
Summary
  'godot --quit' ran
    2.43 ± 0.08 times faster than 'godot --single-window --quit'
```

#### Editor

*No popups are opened since there is no more redundant quit confirmation dialog in `master`.*

```yaml
❯ hyperfine -w1 -i "godot /tmp/4/project.godot --single-window --quit" "godot /tmp/4/project.godot --quit"
Benchmark #1: godot /tmp/4/project.godot --single-window --quit
  Time (mean ± σ):      3.453 s ±  0.380 s    [User: 1.825 s, System: 0.252 s]
  Range (min … max):    3.072 s …  3.821 s    10 runs
 
Benchmark #2: godot /tmp/4/project.godot --quit
  Time (mean ± σ):      3.307 s ±  0.361 s    [User: 1.839 s, System: 0.255 s]
  Range (min … max):    2.942 s …  3.836 s    10 runs
 
Summary
  'godot /tmp/4/project.godot --quit' ran
    1.04 ± 0.16 times faster than 'godot /tmp/4/project.godot --single-window --quit'
```

### Steps to reproduce

- Remove all projects from the project list, so that the *"You don't have any projects"* appears next time you start the project manager.
- Test project manager:
  - Run `godot --quit` from a terminal several times. You can use the `time` command or [`hyperfine`](https://github.com/sharkdp/hyperfine) for benchmarking.
  - Run `godot --single-window --quit` from a terminal several times.
- Test editor:
  - Create a new project and keep it blank.
  - Run `godot /path/to/project.godot --quit` from a terminal several times. You can use the `time` command or [`hyperfine`](https://github.com/sharkdp/hyperfine) for benchmarking.
  - Run `godot /path/to/project.godot--single-window --quit` from a terminal several times.

### Minimal reproduction project

N/A
Repository: kubernetes
Issue: taint node,controller manager can not delete pod 
Labels: kind/bug,sig/api-machinery,sig/apps,help wanted,triage/accepted

### What happened?

one statefulset pod "statefulsettestpod-0" is running on node2,  the pod toleration is 

`
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 30
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 30
  - effect: NoExecute
    key: node.kubernetes.io/unschedulable
    operator: Exists
    tolerationSeconds: 30

`
  i taint the node with such command 

`
kubectl cordon node2
kubectl taint node node2 node.kubernetes.io/unschedulable:NoExecute
kubectl taint node node2 node.kubernetes.io/unschedulable:NoSchedule

`
the pod "statefulsettestpod-0" is deleted by the controller-manager (taint_manager),the i remove the taints with such command 

`
kubectl uncordon node2

kubectl taint node node2 node.kubernetes.io/unschedulable-
`
the pod "statefulsettestpod-0"  will be created on node2.  then quickly taint the node again (within one minute ) ,the statefulset pod will not be deleted by the controller-manager.the pod will be running on the node forever.

when i check the controller-manager log, we find this log:

`
W0102 07:42:44.106398       1 timed_workers.go:115] Trying to add already existing work for &{NamespacedName:67a41957-f57d-4156-ae53-dc796a3c66f2/statefulsettestpod-0}. Skipping.

`
when i check the taint_manager code, when taint_manager delete pod, the pod name will not be deleted from the workerque.

`
func (q *TimedWorkerQueue) getWrappedWorkerFunc(key string) func(args *WorkArgs) error {
	return func(args *WorkArgs) error {
		err := q.workFunc(args)
		q.Lock()
		defer q.Unlock()
		if err == nil {
			// To avoid duplicated calls we keep the key in the queue, to prevent
			// subsequent additions.
			q.workers[key] = nil
		} else {
			delete(q.workers, key)
		}
		return err
	}
}


`

### What did you expect to happen?

the pod will be deleted after taint the node

### How can we reproduce it (as minimally and precisely as possible)?

1.taint the node
2.remove the taint from the node
3. taint the node again quickly (within on minute)

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```
1.20.5
</details>


### Cloud provider

<details>
physical host
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>
Repository: flutter
Issue: [local_auth] "authenticate" with parameter "useErrorDialogs = true" does not open a dialog
Labels: platform-android,p: local_auth,package,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-android,triaged-android

On Android devices when you try to authenticate with parameter useErrorDialogs = true and the device has hardware biometrics but it is not enrolled - the exception "not enrolled" appear but dialog for going to enroll does not. 
On iOS devices it works as expected.

I make a simple project to test it: [https://github.com/cyrax111/local_auth_test](https://github.com/cyrax111/local_auth_test).


flutter doctor -v
```
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale en-RU)
    • Flutter version 2.8.1 at /Users/administrator/Documents/src/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (4 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/administrator/Library/Android/sdk
    • Platform android-31, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (4 available)
    • SM A730F (mobile)  • 5200c47cb44d3569                     • android-arm64  • Android 9 (API 28)
    • iPhone 12 (mobile) • 084A7514-3F4F-4B7D-9ADB-75E7250DE761 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 12.0.1 21A559 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 97.0.4692.71

• No issues found!
```
Repository: vscode
Issue: Web: Allow non-repository, non-filesystem temporary folders
Labels: feature-request,web,vscode.dev

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

vscode.dev currently has three methods for manipulating files:

1. Open a remote repository directly from github. This is good, but requires that the directory pre-exist.
2. Open a local filesystem folder. This is also good, if you're on a browser that supports it (not mobile or Firefox).
3. Create a new file and save it by downloading it, or open a file by uploading it. This is alright, but opening/creating files this way doesn't create a folder and the explorer will continue to say only "No folder opened".

My proposal is a fourth method for manipulating files: Create/upload temporary folder. Much like the third option, you could create an empty folder workspace from a command or a pre-populated one by uploading an archive, and you can save all the files at once by downloading the archive. This folder isn't intrinsically linked to the file system, so the option would be available in browsers that don't support filesystem access. Files would be saved and opened within the temporary folder, with upload and download being separate options.

The temporary folder would also have a "Publish to GitHub" option, which would just turn the folder into a remote repository when used.
Repository: pytorch
Issue: Kernel fusion for Gather, Apply, Scatter (GAS) model
Labels: module: sparse,triaged,module: scatter & gather ops

### 🚀 The feature, motivation and pitch

In graph processing and learning, a famous concept is the **Gather, Apply, Scatter (GAS)** model that utilizes three conceptual phases:

1. **gather**: In the *gather* phase, edge-level information of adjacent nodes and edges is collected
2. **apply**: In the *apply* phase, a user-defined function (UDFs) updates the collected values of the previous phase
3. **scatter**: In the *scatter* phase, updated values are reduced/aggregated to node-level information, e.g., via a particular `scatter_reduce` function such as `"sum"`, `"mean"` or `"max"`

This general blueprint can easily be implemented in PyTorch, *e.g.*:
```python
node_feat = ...  # [num_nodes, num_features]
edge_index = ...  # [2, num_edges] in COO format

# gather phase:
src_node_feat = node_feat[edge_index[0]]
dst_node_feat = node_feat[edge_index[1]]

# apply phase:
edge_feat = torch.cat([src_node_feat, dst_node_feat], dim=-1)
edge_feat = lin(edge_feat)

# scatter phase:
torch.scatter_reduce(edge_feat, edge_index[1], dim=0, reduce="sum")
```
While this scheme is heavily parallelizable, it has the disadvantage of consuming O(`num_edges`) memory. However, in some cases, the GAS model can be replaced by a simple sparse-matrix multiplication operation (leading to improved efficiency), *i.e.*
```python
dst_node_feat = node_feat[edge_index[0]]
edge_feat = edge_weight * dst_node_feat
torch.scatter_reduce(edge_feat, edge_index[1], dim=0, reduce="sum")
```
is equivalent to doing
```python
adj = torch.sparse_coo_tensor(edge_index, edge_weight).t()
adj @ node_feat
```
For other UDFs, optimization may be possible by computing optimized kernels on the fly (similar to the [KeOps](https://www.kernel-operations.io/keops/index.html) library).

It would be great if PyTorch supports such optimizations via kernel fusion internally, *e.g.*, on the TorchScript level. The [PyG](https://github.com/pyg-team/pytorch_geometric) team is happy to discuss further and help in any possible way.

### Alternatives

* Currently, the user needs to apply such optimization on its own, *e.g.*, replacing GAS by `spmm` whenever applicable. For other UDFs, there do not exist any alternatives.

### Additional context

* This scheme is heavily used in the [PyTorch Geometric (PyG)](https://github.com/pyg-team/pytorch_geometric) library. Optimizations of it can heavily improve efficiency of PyG.
* The [KeOps](https://www.kernel-operations.io/keops/index.html) library already allows to perform such kind of optimizations for dense tensors (it will compute an optimized kernel on the fly), but does not have support for the GAS model

cc @nikitaved @pearu @cpuhrsch
Repository: pytorch
Issue: Why AMP make backward speed more slow?
Labels: module: cuda,triaged

### 🐛 Describe the bug

Here is my test code:

```python
import cv2
import numpy as np
import torch
import torch.nn.functional as F
from torchvision.models.resnet import resnet50
from torchvision.datasets.fakedata import FakeData
from torchvision import transforms
import time


# ----------------------------- test on half 
t0 = time.perf_counter()


transform = transforms.Compose(
    [
        transforms.Resize(224),
        transforms.ToTensor(),
    ]
)
model = resnet50().cuda()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
scaler = torch.cuda.amp.GradScaler()
data = FakeData(size=100, transform=transform)
ds = torch.utils.data.DataLoader(data, batch_size=3)
for epoch in range(10):
    for input, target in ds:
        optimizer.zero_grad()
        with torch.cuda.amp.autocast():
            input = input.cuda()
            target = target.cuda()
            t00 = time.perf_counter()
            output = model(input)
            loss = F.cross_entropy(output, target)
            t01 = time.perf_counter()
            print('model forward： ', t01 - t00)
            print(loss.dtype)
        t01 = time.perf_counter()
        scaler.scale(loss).backward()
        scaler.step(optimizer)
        scaler.update()
        t02 = time.perf_counter()
        print('loss backward： ', t02 - t01)

# --------------- without AMP
# model = resnet50().cuda()
# optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
# data = FakeData(size=100, transform=transform)
# ds = torch.utils.data.DataLoader(data, batch_size=3)
# for epoch in range(10):
#     for input, target in ds:
#         optimizer.zero_grad()
#         input = input.cuda()
#         target = target.cuda()
#         t00 = time.perf_counter()
#         output = model(input)
#         loss = F.cross_entropy(output, target)
#         print(loss.dtype)
#         t01 = time.perf_counter()
#         print('model forward： ', t01 - t00)
#         loss.backward()
#         optimizer.step()
#         t02 = time.perf_counter()
#         print('loss backward： ', t02 - t01)

t1 = time.perf_counter()
print('t: ', t1 - t0)

```


Result:

```
using AMP:
loss backward：  0.03126340499147773
model forward：  0.01168522983789444

without AMP:
loss backward：  0.017987865954637527
model forward：  0.020431655924767256

```

As you can see, if fp16 enable, the forward might faster, but backward much more slower , why? My test GPU was T4

### Versions

pytorch 1.10

cc @ngimel
Repository: vscode
Issue: [PWA] Make use of the Window Controls Overlay feature to display menus in the title bar area
Labels: feature-request,titlebar,web

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
The Window Controls Overlay PWA feature is coming out of origin trial and is shipping with Chrome/Edge 98.

To learn more about it, here are a few resources:

* https://alistapart.com/article/breaking-out-of-the-box/
* https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API
* https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/window-controls-overlay
* https://web.dev/window-controls-overlay/

In short, it allows PWAs installed on desktop OSes to regain control of the area normally reserved for the standard title bar. With it, the maximize/minimize/close/pwa buttons appear as overlays on top of the web content, and the rest of the title bar is gone.

It comes with a JS API and some CSS variables that help PWA make efficient use of the regained space.

Using this, the VS Code PWA could display its title bar at the top of the window, just like in its native version.
The hamburger menu version of it could still be used when the title bar area is too narrow (which is easy to detect with the ongeometrychange event).
Repository: godot
Issue: Input.MOUSE_MODE_HIDDEN does not release hover focus
Labels: bug,topic:input,topic:gui

### Godot version

3.4.2

### System information

OS : MANJARO Kernel : 5.15.12-1

### Issue description

When i hide cursor on top of control node (in my case is button) does not release hover. or is there any workaround to this?

### Steps to reproduce

https://user-images.githubusercontent.com/55371083/149496875-00a34864-5668-413c-99fb-90991da543f3.mp4




### Minimal reproduction project

the project in is my gitbub : [https://github.com/alvinseptiano/input_cursor](url)
Repository: vscode
Issue: [html] Improve `html.autoCreateQuotes` to handle manually typed quotes
Labels: feature-request,html

Open a HTML file and type character-by-character (without looking at the screen):
* `<div class="asd">`
* observe that you end up with
* `<div class=""asd"></div>`
Repository: rust
Issue: [ER] slice::all_equal
Labels: C-feature-request,T-libs

A simple function that worth having is slice::all_equal, similar to slice::is_sorted:

```rust
pub fn all_equal(&self) -> bool where T: PartialEq<T>;
pub all_equal_by<F>(&self, compare: F) -> bool where F: FnMut(&T, &T) -> bool;
```

The function returns true if all the items of the slice are equal. if len(slice) < 2 it returns true.

Similar Iterator::all_equal / Iterator::all_equal_by functions could be added later.

The semantics is simple (for iterators the code gets a bit longer):

```rust
fn all_equal<T: PartialEq>(this: &[T]) -> bool {
    this.array_windows().all(|[a, b]| a == b)
}
```