sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [JIT] allow `Optional[torch.Generator]` be tracable in Python
Labels: oncall: jit

## 🚀 Feature

There is no issue with JIT tracing `c10::optional<Generator>` in ATen, and the dispatch mechanism handles the device type.
In Python, unfortunately, there is no possibility to know the device type in advance, so having an optional argument with `None` as the its default value seems like a reasonable approach to try.

This, however, fails, as the following example shows:

```python
In [1]: import torch

In [2]: from typing import Optional

In [3]: def f(x: torch.Tensor, gen: Optional[torch.Generator] = None):
   ...:     gen = torch.Generator(device=x.device) if gen is None else gen
   ...:     return torch.rand(*x.shape, generator=gen)
   ...: 

In [4]: f(torch.rand(3))
Out[4]: tensor([0.2673, 0.8725, 0.3353])

In [5]: f(torch.rand(3))
Out[5]: tensor([0.2673, 0.8725, 0.3353])

In [6]: f = torch.jit.script(f)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-6-631823b487c6> in <module>
----> 1 f = torch.jit.script(f)

~/git/Quansight/pytorch/torch/jit/_script.py in script(obj, optimize, _frames_up, _rcb, example_inputs)
   1309         if _rcb is None:
   1310             _rcb = _jit_internal.createResolutionCallbackFromClosure(obj)
-> 1311         fn = torch._C._jit_script_compile(
   1312             qualified_name, ast, _rcb, get_default_args(obj)
   1313         )

~/git/Quansight/pytorch/torch/jit/annotations.py in try_ann_to_type(ann, loc)
    340             maybe_type = try_ann_to_type(a, loc)
    341             msg = "Unsupported annotation {} could not be resolved because {} could not be resolved."
--> 342             assert maybe_type, msg.format(repr(ann), repr(maybe_type))
    343             inner.append(maybe_type)
    344         return UnionType(inner)    # type: ignore[arg-type]

AssertionError: Unsupported annotation typing.Optional[torch._C.Generator] could not be resolved because None could not be resolved.
  
```
Repository: rust
Issue: Inserting a conditional `break` in working code causes strange borrowck error
Labels: A-borrow-checker,T-compiler,C-bug,A-control-flow

<!--
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.
-->

This code compiles successfully:

```rust
pub struct Node {
    left: Option<Box<Node>>,
}

pub fn remove_min(
    root: &mut Option<Box<Node>>,
) {
    let mut p = root;
    while p.as_ref().unwrap().left.is_some() {
        let q = p.as_mut().unwrap();
        p = &mut q.left;
    }
    p.take();
}
```

I tried this version:

```rust
pub struct Node {
    left: Option<Box<Node>>,
}

pub fn remove_min(
    root: &mut Option<Box<Node>>,
) {
    let mut p = root;
    while p.as_ref().unwrap().left.is_some() {
        let q = p.as_mut().unwrap();
        if true { // or any arbitrary expression
            break;
        }
        p = &mut q.left;
    }
    p.take();
}
```

I expected this to compile successfully.

Instead, this happened:

```
error[E0499]: cannot borrow `*p` as mutable more than once at a time
  --> <source>:16:5
   |
10 |         let q = p.as_mut().unwrap();
   |                 - first mutable borrow occurs here
...
16 |     p.take();
   |     ^
   |     |
   |     second mutable borrow occurs here
   |     first borrow later used here

error: aborting due to previous error
```

### Meta

Occurs on stable (1.56) on the [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d80ce203d520eb9e52fdd6468c7499ac).

Notably, this [compiles succesfully](https://rust.godbolt.org/z/EnY4rxxsG) with polonius.
Repository: pytorch
Issue: libtorch_cuda links against wrong libnccl.so
Labels: module: build,module: abi,triaged,module: third_party,Stale

## 🐛 Bug

I am building the pytorch 1.10 from source and realized if system has nccl, libtorch_cuda.so will link against system one instead of third_party nccl. I confirmed that I didn't set USE_SYSTEM_NCCL during compilation.
```
deepspeed@4f7dc15955a0:/tmp/pytorch/build/lib$ ldd libtorch_cuda.so
	linux-vdso.so.1 (0x00007ffc86152000)
	libcudart.so.11.0 => /usr/local/cuda/lib64/libcudart.so.11.0 (0x00007fb9260c5000)
	libc10_cuda.so => /tmp/pytorch/build/lib/libc10_cuda.so (0x00007fb92606f000)
	libcusparse.so.11 => /usr/local/cuda/lib64/libcusparse.so.11 (0x00007fb9184f8000)
	libcurand.so.10 => /usr/local/cuda/lib64/libcurand.so.10 (0x00007fb912d6a000)
	libcusolver.so.11 => /usr/local/cuda/lib64/libcusolver.so.11 (0x00007fb905eae000)
	libnvToolsExt.so.1 => /usr/local/cuda/lib64/libnvToolsExt.so.1 (0x00007fb905ca3000)
	libnccl.so.2 => /usr/lib/x86_64-linux-gnu/libnccl.so.2 (0x00007fb8fe5d6000)
	librt.so.1 => /usr/lib/x86_64-linux-gnu/librt.so.1 (0x00007fb8fe5cb000)
	libpthread.so.0 => /usr/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb8fe5a8000)
	libc10.so => /tmp/pytorch/build/lib/libc10.so (0x00007fb8fe53c000)
	libtorch_cpu.so => /tmp/pytorch/build/lib/libtorch_cpu.so (0x00007fb8f3e06000)
	libdl.so.2 => /usr/lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb8f3dfe000)
	libcufft.so.10 => /usr/local/cuda/lib64/libcufft.so.10 (0x00007fb8e8605000)
	libcublas.so.11 => /usr/local/cuda/lib64/libcublas.so.11 (0x00007fb8e15c5000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb8e13e3000)
	libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007fb8e1294000)
	libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb8e1279000)
	libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007fb8e1085000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb951937000)
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fb8e1043000)
	libcublasLt.so.11 => /usr/local/cuda/lib64/libcublasLt.so.11 (0x00007fb8d5465000)
deepspeed@4f7dc15955a0:/tmp/pytorch/build/lib$ ll /usr/lib/x86_64-linux-gnu/libnccl.so.2
lrwxrwxrwx 1 root root 16 Apr  4  2021 /usr/lib/x86_64-linux-gnu/libnccl.so.2 -> libnccl.so.2.9.6
```
Interestingly, when I do
```
>>> import torch
>>> torch.cuda.nccl.version()
(2, 10, 3)
```
I also looked into ncc.cmake but didn't figure out why it used system nccl. How can I build pytorch with its own nccl?
## To Reproduce

Steps to reproduce the behavior:

1. use `nvidia/cuda:11.3.0-devel-ubuntu20.04`
2. build the pytorch from source with 
```
git clone https://github.com/pytorch/pytorch.git && cd pytorch && git checkout v1.10.0 && git submodule sync && git submodule update --init --recursive && sudo TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0" python3 setup.py install
```


<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior
libtorch_cuda.so should link with pytorch nccl 2.10.3




cc @malfet @seemethere
Repository: pytorch
Issue: [subgraph_rewriter] Support skipping matching for some ops
Labels: triaged,Stale,module: fx

## 🐛 Bug

Sometimes we need to skip matching some patterns based on some configuration. For example, let's say we have the following model:

```
def forward(self, x, y, z):
    x = x.dequantize()
    y = y.dequantize()
    x = torch.add(x, y)
    x = torch.quantize_per_tensor(x, ...)
    z = z.dequantize()
    x = x.dequantize()
    x = torch.add(x, y)
    x = torch.quantize_per_tensor(x, ...)
    return x
```

pattern:
```
def forward(x, y):
    x = x.dequantize()
    y = y.dequantize()
    x = torch.add(x, y)
    x = torch.quantize_per_tensor(x, ...)
    return x
```

And we want to skip matching the first torch.add, we have the following config:
{
"op_and_order": {
    (torch.add, 0): None
}
}

With this config, we'll produce the following result:
```
def forward(self, x, y, z):
    x = x.dequantize()
    y = y.dequantize()
    x = torch.add(x, y)
    x = torch.quantize_per_tensor(x, ...)
    x = torch.ops.quantized.add(x, z, ...)
    return x
```


cc @ezyang
Repository: rust
Issue: rustc sometimes resolves an ambiguous generic parameter instead of erroring
Labels: T-compiler,A-inference,C-bug

Apologies that I don't have a minimum reproduction but I've tried a few ways and thus far failed to reproduce outside of the original crate.

We recently had an error where we were deserializing a dummy object for backwards-compatibility, but the type being read was ambiguous, causing the code to behave unexpectedly. For some reason rustc concretized the object to an `Option<()>` (guessing based on `{:?}` output, as I can't tell why it was concretized) when it was ambiguous (we really wanted an `Option<u64>` but didn't specify it).

You can see the change which fixes it at https://github.com/lightningdevkit/rust-lightning/pull/1195, which makes pretty clear that the object's type was, in fact, ambiguous (switching the changed declaration to `None::<()>` works just as well, while changing behavior). The `read_tlv_fields` macro isn't all that complicated - https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/util/ser_macros.rs#L332 - it basically just calls into `decode_tlv_stream` which is pretty straightforward - https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/util/ser_macros.rs#L168.

I tried (and failed) to get a minimum reproduction which at least shows the high-level code structure at https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=c873827053afdaa20d333703d00fd16f (the actual relevant things are mostly in `util::ser` and `util::ser_macros` in the real code).
Repository: storybook
Issue: Out-of-memory in development mode.
Labels: bug,performance issue,block: source

**Describe the bug**
Out-of-memory in development mode. Static build works fine.

**To Reproduce**
Check out https://github.com/avendiart/storybook-issue, first commit is without the crash, the latest crashes. Start storybook, switch to the `Buttons` story to `Docs`. Please note, that is the most minimal reproduction I could come up with. With a different storybook, which I unfortunately can't share, crashes without even switching to the tab.

**System**
```
Environment Info:

  System:
    OS: Linux 5.10 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  npmPackages:
    @storybook/addon-actions: ^6.4.0 => 6.4.0 
    @storybook/addon-essentials: ^6.4.0 => 6.4.0 
    @storybook/addon-links: ^6.4.0 => 6.4.0 
    @storybook/react: ^6.4.0 => 6.4.0
```

**Additional context**
I've managed to pinpoint the issue to `react-element-to-jsx-string` starting from version `14.3.3`. I'd assume that either the library itself or one of it's dependencies causes the crash.
Repository: pytorch
Issue: Lazy Tensor Core Documentation Out-of-Date
Labels: module: docs,triaged,module: xla,module: lazy

## ❓ Questions and Help

The Lazy Tensor Core documentation found in the [README.md](https://github.com/pytorch/pytorch/blob/lazy_tensor_staging/lazy_tensor_core/README.md) appears to be very out-of-date. Are there any more up-to-date resources/guidelines for adding a new vendor backend?

The example [lazy_xla](https://github.com/pytorch/xla/tree/asuhan/xla_ltc_plugin) architecture also appears to be very out of date as well. Is there a more up-to-date example that can be referenced when implementinga new vendor backend?

### Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of [listed resources available on the website](https://pytorch.org/resources). Our primary means of support is our discussion forum:

- [Discussion Forum](https://discuss.pytorch.org/)


cc @brianjo @mruberry @bdhirsh
Repository: flutter
Issue: Wayland: support the xdg-decoration protocol to use server-side decorations when available
Labels: c: new feature,a: fidelity,platform-linux,c: proposal,a: desktop,P3,team-linux,triaged-linux

Use case
--------

A user running a Flutter app on Sway, River, Kwin (KDE or lxqt), etc. probably prefers server-side decorations (SSD). Wayland mandates support for client-side decorations (CSD) but just about every Wayland compositor besides GNOME also supports SSD.

When a Wayland compositor supports SSD, users would probably rather use those.

Proposal
--------

The optional [xdg-decoration extension](https://wayland.app/protocols/xdg-decoration-unstable-v1) to the Wayland protocols allow programs to figure out whether the Wayland compositor supports server-side decorations. This is used by programs such as mpv (a minimal media player) to determine whether or not to draw their own titlebars.

If Flutter detects SSD support via the xdg-decoration protocol, it should use that to delegate window decorations to the compositor of drawing its own GDK titlebars that look out-of-place outside GNOME.

Screenshots of the status quo
-----------------------------

These screenshots were taken on Sway, a Wayland compositor that supports tiling, tabbed, and floating layouts.

<figure>

![csd Flutter app next to SSD programs](https://user-images.githubusercontent.com/44756978/143951789-43987ec9-c98e-45d2-a0fa-d433665a6c57.png)

<figcaption>Fluffychat using a CSD headerbar alongside other  programs using SSD</figcaption>
</figure>
<figure>

![CSD and SSD on Sway (tabbed)](https://user-images.githubusercontent.com/44756978/143950404-00f05fcc-ad8c-4890-943d-5caa6300bf57.png)

<figcaption>A Fluffychat window in tiled layout showing both CSD and SSD</figcaption>
</figure>
Repository: rust
Issue: rustdoc: Source code pages briefly render in other font and weight as page loads
Labels: T-rustdoc,C-bug,A-rustdoc-ui

For example: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_attr/builtin.rs.html#96-99

This happens in macOS Safari. It doesn't seem to occur in Firefox on macOS.

I think this regressed within the last day or two since I would've noticed otherwise.
Repository: pytorch
Issue: make: Makefile: No such file or directory
Labels: module: build,triaged,Stale

## ❓ Questions and Help
when I run python setup.py install,I got the problem:
![image](https://user-images.githubusercontent.com/75877054/143978359-323677b7-ec3c-4fd8-b4c5-2f4352378f56.png)

Does anybody know the reason, it bothers me a lot..:(

cc @malfet @seemethere
Repository: godot
Issue: `OS.get_window_safe_area()` returns incorrect values for iPhone 8 and iPhone X on iOS
Labels: bug,platform:ios,topic:porting

### Godot version

3.4.stable

### System information

iPhone

### Issue description

Using OS.get_window_safe_area() to rearrange Control-Nodes result in unexpected behaviour on iOs.
Script attached to Control Node:
```
extends Control

func _ready():
	var SafeArea = OS.get_window_safe_area();
	rect_position.x = SafeArea.position.x;
	rect_position.y = SafeArea.position.y;
	rect_size.x = SafeArea.size.x;
	rect_size.y = SafeArea.size.y;
```
Tested on physical device in portrait mode.
expected behaviour: 
![expected](https://user-images.githubusercontent.com/8083536/144006546-bba81507-ce85-44b0-8e00-e81eea815da7.png)

current behaviour:

![result](https://user-images.githubusercontent.com/8083536/144006593-cdbec51e-0315-4c43-9472-42aad92a93bc.png)



### Steps to reproduce

Add script to Control Node:
```
extends Control

func _ready():
	var SafeArea = OS.get_window_safe_area();
	rect_position.x = SafeArea.position.x;
	rect_position.y = SafeArea.position.y;
	rect_size.x = SafeArea.size.x;
	rect_size.y = SafeArea.size.y;
```

run on iOs

### Minimal reproduction project

_No response_
Repository: flutter
Issue: Add "hoverColor" property to CheckBoxListTile and ExpansionTile Widgets
Labels: c: new feature,framework,f: material design,c: proposal,P3,team-design,triaged-design

## Use case

"hoverColor" property is implemented for a number of Widgets, but for some reason it has not yet been done for CheckBoxListTile and ExpansionTile which affects Web / Desktop UX.

Interesting, that "hoverColor" already exists in CheckBox Widget.

## Proposal

It's quite easy to add this property by modifying respected Widgets.

For CheckBoxListTile:
add to packages/flutter/lib/src/material/checkbox_list_tile.dart
```dart
  const CheckboxListTile({
    Key? key,
    required this.value,
    required this.onChanged,
    this.activeColor,
    this.checkColor,
    this.tileColor,
    this.title,
    this.subtitle,
    this.isThreeLine = false,
    this.dense,
    this.secondary,
    this.selected = false,
    this.controlAffinity = ListTileControlAffinity.platform,
    this.autofocus = false,
    this.contentPadding,
    this.tristate = false,
    this.shape,
    **this.hoverColor,**
    this.selectedTileColor,
  }) 
```

add property

  /// The color for the tile's [Material] when a pointer is hovering over it.
  **final Color? hoverColor;**       

and add into return method

    return MergeSemantics(
      child: ListTileTheme.merge(
        selectedColor: activeColor ?? Theme.of(context).toggleableActiveColor,
        child: ListTile(
          leading: leading,
          title: title,
          subtitle: subtitle,
          trailing: trailing,
          isThreeLine: isThreeLine,
          dense: dense,
          enabled: onChanged != null,
          onTap: onChanged != null ? _handleValueChange : null,
          selected: selected,
          autofocus: autofocus,
          contentPadding: contentPadding,
          shape: shape,
          selectedTileColor: selectedTileColor,
          tileColor: tileColor,
          **hoverColor: hoverColor,**
        ),
      ),
    ); 

ExpansionTile can be extended in the same way

I have created a pull request #91289 for these modification, but, unfortunately have not created test cases (have no experience) and the pull request was closed. Is it necessary to create new tests for such a minor update?.. If no, probably, the PR could be re-opened and merged.

Thanks!
Repository: ant-design
Issue: React app with Typescript failes to find the component interfaces
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### Reproduction link
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/condescending-chaum-g1ev3?file=/src/StyledComponents.tsx)

### Steps to reproduce
- Open sandbox
- Open StyledComponents.tsx
- Wait for the compiler to finish and for the packages to load (might take a while)
- You should see an typescript error

```
Exported variable 'StyledAlert' has or is using name 'AlertInterface' from external module "/sandbox/node_modules/antd/lib/alert/index" but cannot be named
```

This error happens for a lot of components which for some reason use private interfaces

### What is expected?
All interfaces used for exports are exported and typescript can grab them

### What is actually happening?
Typescript can not build type definition from hidden interfaces

| Environment | Info |
|---|---|
| antd | 4.17.2 |
| React | any |
| System | any |
| Browser | any |

---
Please check all components for those non exported interfaces. There are more. Table for instance.
Referring to this older ticket https://github.com/ant-design/ant-design/issues/24864


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: go
Issue: net: skip TestIPv4MulticastListener on linux without CONFIG_IP_MULTICAST
Labels: NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
go version go1.17.2 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/src/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/src/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/usr/local/src/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4211212346=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

`go test -run TestIPv4MulticastListener net`

I'm running this command from within a Linux machine whose kernel was built without CONFIG_IP_MULTICAST.

### What did you expect to see?

`TestIPv4MulticastListener` skipped because IP multicast is not enabled.

In fact this was already proposed by @bradfitz in https://github.com/golang/go/issues/11936#issuecomment-126262150 but never implemented.

### What did you see instead?

```sh
--- FAIL: TestIPv4MulticastListener (0.00s)
    listen_test.go:570: 224.0.0.254 not found in multicast rib
FAIL
FAIL    net     0.005s
FAIL
```
Repository: flutter
Issue: [Web] Support user defined font request URL
Labels: framework,a: internationalization,a: china,a: typography,platform-web,P2,has partial patch,team-web,triaged-web

Because of [GWF](https://en.wikipedia.org/wiki/Great_Firewall), Chinese users cannot access Google services normally, Flutter needs to provide proxy configuration to access google font.

example question: [Google Fonts Unstable in China – Here is How to Fix It](https://chineseseoshifu.com/blog/google-fonts-instable-in-china.html)

## Use case
- dart code: 
![image](https://user-images.githubusercontent.com/5383506/144026080-ef3551ef-9a28-4ed2-9e45-74dcd2060b58.png)
- Chinese characters not show:
![Chinese characters not show](https://user-images.githubusercontent.com/5383506/144024133-9d3ba28f-47e8-45a0-9998-c841ca3d5aad.jpg)
- Unable to get robot font:
![Unable to get robot font](https://user-images.githubusercontent.com/5383506/144024522-637f4803-751c-4793-a2a3-3ed042f08b82.jpg)
- Font api unable:
![Unable to get font api](https://user-images.githubusercontent.com/5383506/144024724-abcc3496-91f0-4e25-8d3d-82990210f8e6.jpg)




## Proposal
Flutter needs to provide proxy configuration to access google font.
I have submitted PR