sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Tensor slice copy across multiple devices fails silently
Labels: triaged,module: advanced indexing

### 🐛 Describe the bug

When trying to update certain elements between two tensors with the source on GPU memory and the target on CPU memory, the .copy_ operation fails silently. Below is an example:

```
import torch as pt

dims = (4,5,)
gpu0 = pt.device(0)

# src and tgt matrices...src on gpu0...target on CPU
src = pt.randn(*dims).to(gpu0)
tgt = pt.zeros(dims)

# mask and idxs
mask = src > 0                     # sample function...mask on GPU
idxs = mask.nonzero(as_tuple=True) # idxs on GPU as well

# copy elements
tgt[idxs].copy_(src[idxs])  # does not update tgt
```

### Versions

Collecting environment information...
PyTorch version: 1.10.0+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.17.3
Libc version: glibc-2.25

Python version: 3.6.9 (default, Jun 29 2022, 11:45:57)  [GCC 8.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-124-generic-x86_64-with-Ubuntu-18.04-bionic
Is CUDA available: True
CUDA runtime version: 11.3.109
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3070 Ti
Nvidia driver version: 470.141.03
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.10.0+cu113
[pip3] torch-scatter==2.0.5
[pip3] torchaudio==0.10.0+cu113
[pip3] torchvision==0.11.1+cu113
[conda] blas                      1.0                         mkl  
[conda] mkl                       2020.0                      166  
[conda] mkl-service               2.3.0            py37he904b0f_0  
[conda] mkl_fft                   1.0.15           py37ha843d7b_0  
[conda] mkl_random                1.1.0            py37hd6b4f25_0  
[conda] numpy                     1.18.1           py37h4f9e942_0  
[conda] numpy-base                1.18.1           py37hde5b4d6_1  
[conda] numpydoc                  0.9.2                      py_0
Repository: flutter
Issue: Consider rewriting a macOS/iOS plugin using ObjC interop
Labels: platform-ios,package,P2,team-ios,triaged-ios

It would be potentially useful to rewrite one of our small, non-UI-based plugin for iOS and/or macOS using [Objective-C FFI](https://dart.dev/guides/libraries/objective-c-interop). This would ensure that we are eating our own dogfood for this version of FFI (just as we do for Windows and Linux currently), testing regularly in CI, etc.

The primary candidates I can see here are `shared_preferences` and `path_provider`; both use APIs that shouldn't have threading issue, and they are very simple plugins so rewriting one of them should be a quick project. It would also be a good opportunity to unify the iOS and macOS implementations without any additional work (something we were already planning on doing now that we're moving to allowing Swift for 1P iOS plugins, which is the only reason the macOS versions were separate).

/cc @jmagman capturing from discussion.
Repository: node
Issue: Weak Diffie-Hellman groups provided by crypto module
Labels: crypto,security

Node exposes various IKE MODP groups. It appears the list was chosen by exporting every group provided by OpenSSL:
https://github.com/nodejs/node/blob/main/src/crypto/crypto_dh.cc#L222-L229
https://nodejs.org/api/crypto.html#class-diffiehellmangroup

However, some of these groups are too small to be used. See [RFC 8247, section 2.4](https://www.rfc-editor.org/rfc/rfc8247#section-2.4):

> Group 5 or the 1536-bit MODP Group has been downgraded from MAY in
>   [RFC 4307](https://www.rfc-editor.org/rfc/rfc4307) to SHOULD NOT.  It was specified earlier, but is now
>   considered to be vulnerable to being broken within the next few years
>   by a nation-state-level attack, so its security margin is considered
>   too narrow.
>
>   Group 2 or the 1024-bit MODP Group has been downgraded from MUST- in
>   [RFC 4307](https://www.rfc-editor.org/rfc/rfc4307) to SHOULD NOT.  It is known to be weak against sufficiently
>   funded attackers using commercially available mass-computing
>   resources, so its security margin is considered too narrow.  It is
>   expected in the near future to be downgraded to MUST NOT.
>
>   Group 1 or the 768-bit MODP Group was not mentioned in [RFC 4307](https://www.rfc-editor.org/rfc/rfc4307) and
>   so its status was MAY.  It can be broken within hours using cheap
>   off-the-shelf hardware.  It provides no security whatsoever.  It has,
>   therefore, been downgraded to MUST NOT.

These are all exposed by Node as "modp1", "modp2", and "modp5". The documentation should reflect their status and they should be deprecated and removed, especially modp1.
Repository: rust
Issue: Recover from incorrect placement of `const`, `mut`, `&`, `*`
Labels: A-diagnostics,T-compiler

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->

Given the following code: [link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=76abd80a50e7c8c4335a9a6d91612d9a)

```rust
fn inc(num: mut& i32) {
    *num += 1;
}

fn main() {
    let x = 12;
    let _ptr: const* i32 = x&;
 
    let mut y = 34;
    inc(y &mut);
}
```

The current output is:

```
Compiling playground v0.0.1 (/playground)
error: expected type, found keyword `mut`
 --> src/main.rs:1:13
  |
1 | fn inc(num: mut& i32) {
  |             ^^^ expected type

error: expected type, found keyword `const`
 --> src/main.rs:7:15
  |
7 |     let _ptr: const* i32 = x&;
  |         ----  ^^^^^ expected type
  |         |
  |         while parsing the type for `_ptr`

error[[E0423]](https://doc.rust-lang.org/nightly/error-index.html#E0423): expected value, found crate `num`
 --> src/main.rs:2:6
  |
2 |     *num += 1;
  |      ^^^ not a value

For more information about this error, try `rustc --explain E0423`.
error: could not compile `playground` due to 3 previous errors
```

<!-- The following is not always necessary. -->
Ideally the output should inform the user that for `&` and `*` it goes in front of the keyword or variable and for the `&mut` placed after the variable, a suggestion should be emitted to switch the position of those 2 things.

<!--
If the problem is not self-explanatory, please provide a rationale for the
change.
-->

<!--
If dramatically different output is caused by small changes, consider also
adding them here.

If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions. The output might also be
different depending on the Edition.
-->
Repository: terminal
Issue: Add a note about the OS language selector to the FAQ
Labels: Issue-Docs,Product-Meta,Area-Localization

__Originally posted by @DHowett in https://github.com/microsoft/terminal/issues/13920#issuecomment-1238366335__
Repository: rust
Issue: Invalid help suggestion when `vec` macro incorrectly used without `!`
Labels: A-diagnostics,A-resolve,A-parser,P-low,T-compiler,D-papercut

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->

Given the following code: [link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=433f5fb763feea6d7b5c3d280c6d0173)

```rust
fn main() {
    let _x = vec[1, 2, 3];
}
```

The current output is:

```
   Compiling playground v0.0.1 (/playground)
error: expected `;`, found `[`
 --> src/main.rs:2:17
  |
2 |     let _x = vec[1, 2, 3];
  |                 ^
  |
help: consider adding `;` here
  |
2 |     let _x = vec;[1, 2, 3];
  |                 +

error: could not compile `playground` due to previous error
```

<!-- The following is not always necessary. -->
Just for some context this is the current error message for the stable and beta versions:

```
   Compiling playground v0.0.1 (/playground)
error: expected one of `.`, `?`, `]`, or an operator, found `,`
 --> src/main.rs:2:19
  |
2 |     let _x = vec[1, 2, 3];
  |                   ^ expected one of `.`, `?`, `]`, or an operator

error: could not compile `playground` due to previous error
```
Which is also not ideal as for the other std macros AFAIK (only checked a few), incorrect usage (i.e. without the `!`) will lead to a help suggestion informing the user to include a `!` to invoke a macro (e.g. `print`, `println`).

Hence, the ideal output is to suggest adding the `!` when invoking the `vec` macro incorrectly as with other macros.

@rustbot label +regression-from-stable-to-nightly +D-invalid-suggestion

May need a bisect.

<!--
If the problem is not self-explanatory, please provide a rationale for the
change.
-->

<!--
If dramatically different output is caused by small changes, consider also
adding them here.

If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions. The output might also be
different depending on the Edition.
-->
Repository: pytorch
Issue: module: multiprocessing SimpleQueue put cannot bigger 716 in windows.And it is not has any info.The program is blocked and does not move.
Labels: module: multiprocessing,triaged

### 🐛 Describe the bug

#run the code.It is not has any info,and not work.
#python3.9.13 64-bit windows10  torch1.12.1+cu116
#the last code is connection.py  line 205          self._send_bytes(m[offset:offset + size])

from torch import multiprocessing as mp
ctx = mp.get_context("spawn")
free_queue = ctx.SimpleQueue()
full_queue = ctx.SimpleQueue()


for m in range(1536):
    print("put data index:",m)
    if(m==716):
        print("The program is blocked and does not move in 716.")
    free_queue.put(m)
print("It is not go end.")

### Versions

Collecting environment information...
PyTorch version: 1.12.1+cu116
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 家庭中文版
GCC version: (GCC) 5.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19044-SP0
Is CUDA available: True
CUDA runtime version: 11.7.64
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1070
Nvidia driver version: 516.59
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cudnn_ops_train64_8.dll
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.2
[pip3] torch==1.12.1+cu116
[pip3] torch-tb-profiler==0.4.0
[pip3] torchaudio==0.12.1+cu116
[pip3] torchvision==0.13.1+cu116
[conda] Could not collect

cc @VitalyFedyunin
Repository: pytorch
Issue: torch.jit.script IndentationError: unexpected indent
Labels: oncall: jit

### 🐛 Describe the bug

```
import torch
import torchvision
import torchvision.models as models
import torch.nn as nn
from torch.utils.mobile_optimizer import optimize_for_mobile

class ModifiedResNet18Model(torch.nn.Module):
	def __init__(self):
		super(ModifiedResNet18Model, self).__init__()
		model = models.resnet18(pretrained=True)
		modules = list(model.children())[:-1]      
		model = nn.Sequential(*modules)
		self.features = model

		for param in self.features.parameters():
			param.requires_grad = False

		self.fc = nn.Sequential(
			nn.Dropout(),
			nn.Linear(512,1024),
			nn.ReLU(inplace=True),
                        nn.Dropout(),
			nn.Linear(1024,512),
			nn.ReLU(inplace=True),
			nn.Linear(512, 4))
	
	def forward(self, x):
		x = self.features(x)
		x = nn.functional.adaptive_avg_pool2d(x, 1).reshape(x.shape[0], -1)
		x = self.fc(x)
		return x
		
		

model = ModifiedResNet18Model()
print(model)
model_scripted = torch.jit.script(model) # throwing the error
opti_model = optimize_for_mobile(model_scripted)
opti_model._save_for_lite_interpreter("resnet4.ptl")
print('Create Model Success')



```

### Versions

Torch  Version: 1.11.0+cu113
TorchVision  Version: 0.12.0+cu113

**Error** 
Traceback (most recent call last):
  File "C:\Users\Visionhealth\Desktop\Experiment_3\onlyforpruning\testtorchscript.py", line 37, in <module>
    model_scripted = torch.jit.script(model)
  File "C:\Users\Visionhealth\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit\_script.py", line 1265, in script
    return torch.jit._recursive.create_script_module(
  File "C:\Users\Visionhealth\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit\_recursive.py", line 453, in create_script_module
    AttributeTypeIsSupportedChecker().check(nn_module)
  File "C:\Users\Visionhealth\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit\_check.py", line 74, in check
    init_ast = ast.parse(textwrap.dedent(source_lines))
  File "C:\Users\Visionhealth\AppData\Local\Programs\Python\Python310\lib\ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    def __init__(self):
IndentationError: unexpected indent
Repository: go
Issue: x/vulndb/cmd/vulnreport: include a link to the release for GHSA reports
Labels: NeedsFix,vulncheck or vulndb

For example, for https://github.com/golang/vulndb/issues/829, there was no commit link in the GHSA. It would be helpful to include this link in the issue for triaging:

https://github.com/crypto-org-chain/cronos/releases/tag/v0.8.0
Repository: PowerToys
Issue: [Screen ruler] Toggle between continuous and non-continuous mode from tool bar and keyboard shortcut
Labels: Idea-Enhancement,Product-Screen Ruler

### Description of the new feature / enhancement

It would be nice if it was possible to toggle between continuous and non-continuous mode from tool bar which is visible when screen ruler is active with option to toggle using keyboard shortcut.

### Scenario when this would be used?

For example for normal measuring I'd like to use continuous mode but when I want to take screen shot of it quick option to switch to non-continuous would be better than going to settings of powertoys each time I want to take screen shot.

### Supporting information

_No response_
Repository: pytorch
Issue: Uneven and/or Dynamically sized collectives
Labels: good first issue,triaged,module: c10d

### 🚀 The feature, motivation and pitch

A recurring question we get is how to handle uneven or dynamic sized collectives.

For example, users want to:

- Scatter tensors of different sizes.
- Dynamically determine broadcast tensor sizes on the source rank.

There are plenty of forum questions on this subject that validate the need for such new API.

In addition to be a constant source of problem for our users, such APIs are particularly difficult to efficiently and correctly implement when using NCCL. This stems from the fact that shape calculation happens on CPU but values must transit in CUDA tensors as NCCL doesn't support CPU tensors.

This device mismatch issue is not trivial and resulted in quite a few bugs in c10d's object collectives.

## The API

Add a `torch.distributed.dynamic` package that supports slower collectives that are significantly flexible and address those concerns.

The overall design of those collectives is that they should not assume perfect uniform knowledge across all ranks.

The module would have variants of broadcast, all_gather, gather, scatter, all_to_all that can handle dynamic and uneven tensor sizes transparently for users.

It's unclear whether we should extend this to reduce collectives as we'd have to deal with the issue of missing data.



### Alternatives

Not implement this module and keep suggesting work-arounds to users.

### Additional context

Data-dependent collective shapes is particularly common with models that employ sparse-computation like Mixture-of-Experts.
Repository: go
Issue: net/http: TestTransportReading100Continue failures on `linux/ppc64`
Labels: OS-Linux,NeedsInvestigation,arch-ppc64x

`greplogs -l -e 'FAIL: TestTransportReading100Continue' --since=2022-01-01`
[2022-09-06T16:53:53-dc029f2/linux-ppc64-buildlet](https://build.golang.org/log/934634a1cdfe56b324e88941a8760243ee16ade5)
[2022-08-31T17:15:15-c708532/linux-ppc64-buildlet](https://build.golang.org/log/86254fa6e2a65189b07a42a7fe897bcdabd6a6cc)

(attn @golang/ppc64; CC @neild)
Repository: pytorch
Issue: Accept SymInts and SymFloats For Scalar Inputs
Labels: triaged

### 🚀 The feature, motivation and pitch

When we are a tracing context  (ProxyTensor/FakeTensor/TorchDynamo) tensor -> scalar conversions can cause graph breaks because the tracking tensors do not have real data associated with them. This can occur with user invocations: `x.item()` and in implicit Tensor->Scalar conversions when a 0-element tensor is passed in as a `Scalar` argument. 

ProxyTensor and FakeTensor do some amount of [constant](https://github.com/pytorch/pytorch/pull/84387) tracking for cases where the value of the 0-element tensor is known statically, but there are other cases where this will occur. 

For example, in [adagrad](https://github.com/pytorch/pytorch/blob/master/torch/optim/adagrad.py#L279): `param.addcdiv_(grad, std, value=-clr)`

`addcdiv` has the signature: `addcdiv(Tensor self, Tensor tensor1, Tensor tensor2, *, Scalar value=1) -> Tensor`.  When the config capture_scalar_outputs is true, `-clr` will be a 0-element tensor, and the dispatcher call of _local_scalar_dense in converting `-clr` to a scalar will cause a graph break. 

If Scalars could contain SymInts/Symfloats, `-clr` could be returned from `_local_scalar_dense` as a SymFloat without graph breaking. 

More generally, this might allow us to re-factor the "capture scalar inputs" config to work by tracing SymInts/Symfloats instead of wrapping scalars to tensors, and potentially track other dynamic shape operations that occur from indexing tensor data.
Repository: PowerToys
Issue: Cursor not visible on whitish/greyish paper like background
Labels: Issue-Bug,Idea-Enhancement,Needs-Triage

### Microsoft PowerToys version

0.62.0

### Running as admin

- [X] Yes

### Area(s) with issue?

TextExtractor

### Steps to reproduce

Try to extract text from a document with a whitish/greyish paper like background.


### ✔️ Expected Behavior

The cursor should have enough contrast and be visible

### ❌ Actual Behavior

The cursor is grayish as well making it hard to spot

### Other Software

_No response_
Repository: PowerToys
Issue: Add "Scale" setting to Screen Ruler to match Window's scaling features
Labels: Idea-Enhancement,Product-Screen Ruler

### Description of the new feature / enhancement

When "Scale" is set to a value other than `100%`, that value is used to adjust the output value of Screen Ruler's measurements.

### Scenario when this would be used?

When building a website on a display set to anything other than 100% Scale, taking measurements becomes very complicated. For example, if within Windows Display settings, I set "Scale" to "150%", an element set to `width: 100px;` will render as 150px wide, and Screen Ruler will output the render width rather than the specified width.

This creates difficulty when trying to compare a design to a mockup, or even to accurately take measurements between elements. Adding a "Scale" feature to Screen Ruler, which would match the Windows Display "Scale" feature, and basically "undo" the scaling via math, would dramatically simplify this process.

### Supporting information

_No response_
Repository: PowerToys
Issue: Text Extractor to provide user feedback that action has been done
Labels: Idea-Enhancement,Area-Accessibility,Product-Text Extractor

### Description of the new feature / enhancement

Right now, the Text Extractor has **zero** feedback: no sound, no icon, no toast message. It **must** have at least two.

### Scenario when this would be used?

Users need feedback. Either visual and/or auditive.

### Supporting information

_No response_
Repository: PowerToys
Issue: Quick Accent: show toolbar close to text cursor
Labels: Idea-Enhancement,Area-User Interface,Needs-Triage,Product-Quick Accent

### Description of the new feature / enhancement

Currently, there are **nine fixed** locations for the toolbar to show. It would be lovely if the toolbar pops up just near the text cursor. Having another eight options for _that_ though, would be crazy, so we need a smart choice.

### Scenario when this would be used?

Having the toolbar close.
Repository: PowerToys
Issue: Quick Accent: use CommandBar for better interaction
Labels: Idea-Enhancement,Product-Quick Accent

### Description of the new feature / enhancement

I would like to suggest another way of inserting characters.
Now:

1. Open toolbar via normal procedure
2. press Space or Arrows to highlight a character
3. let go of keys
4. one character is inserted

or:

3. press Enter (any number of times)
4. newline(s) is inserted
5. let go
6. one (accented) character is inserted

What I instinctively expected would be that, when one character is highlighted, **pressing Enter would insert** that char. For each time I press Enter, without closing the UI.
Same story for clicking the UI with a **mouse**: it does nothing. Would be nice if it were actual buttons.

### Scenario when this would be used?

Quickly insert multiple of the same (or related) chars after one another.

### Supporting information

_No response_
Repository: PowerToys
Issue: Quick Accent: add own accented letters and edit the existing ones
Labels: Idea-Enhancement,Needs-Triage,Product-Quick Accent

### Description of the new feature / enhancement

Ability to add, edit or reorder the accented characters in a text configuration file (or directly in the Settings form).

### Scenario when this would be used?

Frequent usage of custom characters like ð, φ or π (especially as math symbols), or unusual diacritics like ę or ő.

### Supporting information

_No response_
Repository: flutter
Issue: Need integration test for Android platform view lifecycles
Labels: platform-android,a: platform-views,P2,from: postmortem,team-android,triaged-android

Identified from post-mortem in b/213345667. 

https://github.com/flutter/engine/pull/26602 caused crashes in 1p apps subsequently fixed with https://github.com/flutter/engine/pull/27655. 

The problem seems to be that adding and removing platform views didn't remove the platform view's focus listener, so sending focus to a platform view removed from the view causes a crash. That needs an integration test.