sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Bool convolutions (and other integral types)
Labels: module: nn,triaged,module: boolean tensor

### 🚀 The feature, motivation and pitch

I'm working on an AI for Dr. Mario and would like to look for certain patterns on the game board. This operation is quite naturally represented as a convolution using the Bool operations (* = and, + = or). In detail:

Suppose you have a game board that's a two dimensional grid with some tokens in each grid space. If you categorize the tokens, you could represent a collection of boards with a one-hot encoding with dimensions {n, c, wb, hb}, where n is the number of boards in the collection, c is the number of categories, wb is the width of the board, and hb its height.

I want to find all the places on the board that have a certain local pattern. A pattern is a rectangle smaller than the board, and a set of allowed categories for each position in the rectangle. You could represent a collection of patterns by a tensor of dimensions {m, c, wp, hp}, where m is the number of patterns in the collection, c is the number of categories, wp is the width of the pattern rectangle, and hp is the height of the pattern rectangle, and where a 1 indicates that the given category is *not* allowed in the given pattern+position. N.B. this one is not one-hot -- there may be any number of categories that are forbidden in a given pattern+position, including none or all of them.

If you use these representations, then calling `conv2d(boards, patterns).logical_not()` with the Bool operations would give you an {m, wb-wp+1, hb-wh+1} tensor with a 1 in exactly the locations that match the relevant pattern... if it actually worked.

### Alternatives

Current workaround plan is to do the convolution with floats and check for equality with zero. It just seems wasteful in both space and time to use floating point operations instead of logical ones.

### Additional context

_No response_

cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
Repository: TypeScript
Issue: Remove Map<any, any> constructor overload
Labels: Suggestion,Awaiting More Feedback

### ⚙ Compilation target

ES2017

### ⚙ Library

lib.es2015.iterable.d.ts

### Missing / Incorrect Definition

This isn't exactly the kind of issue this form (Library issue) seems to be made for, but it looked like the closest match.

The `Map` constructor has an explicit overload to make `new Map()` produce a `Map<any, any>`, rather than safer option of allowing normal type inference to occur. I think the only change that needs to happen is removing the overload. This was already brought up in https://github.com/microsoft/TypeScript/issues/52552, but that was closed because it did not provide a clear usecase, and the focus was on inconsistency between `Map` and `Set`.

For me, the usecase is about `Map` alone - removing a source of silent and infectious `any`s. `noImplicitAny` is a recommended setting for good reason, but is undermined by the presence of `any`s in library types. In fact, I am creating this issue after fixing a bug in my own code that was hidden by this typing. 

A fair counterargument is that it may break existing code. My guess - total speculation - is that the override was added in the past when inference was not as effective, and it is no longer necessary in most cases. Where the empty map is meant to conform to a contextual type, it works fine. Toying around with it myself, I find two main cases where it breaks:
1. `Map<any, any>` was literally the intent. I'd strongly argue these cases should be explicit.
2. The `Map` is constructed without contextual types, but it is meant to conform to them later. As a result, the code in-between those places is unsafe, as in the example below. Though unsafe, this might be a common pattern in practice that the change would break. (Ofc a solution is to explicitly type the `Map` construction.)
```ts
function getWordCounts(text: string): Map<string, number> {
    const m = new Map();
    for (const w of text.split(' ')) {
        m.set(w, (m.get(w) ?? 0) + 1);
    }
    return m;
}
```

### Sample Code

```TypeScript
// The problem is that this at-at-glance reasonable function is returning `any`.
function numRudeWords(input: string | null) {
    //   ^? function numRudeWords(input: string | null): any
    const wordCounts = input ? getWordCounts(input) : new Map();
    //    ^? const wordCounts: Map<any, any>
    return (wordCounts.get('meanie') ?? 0) + (wordCounts.get('dangnabit') ?? 0);
}

function getWordCounts(text: string): Map<string, number> {
    const m = new Map<string, number>();
    for (const w of text.split(' ')) {
        m.set(w, (m.get(w) ?? 0) + 1);
    }
    return m;
}
```


### Documentation Link

The MDN doc link is here, though it's not super relevant to this particular question: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/Map
Repository: rust
Issue: Argument with type `impl FnMut` combined with recursion and closures causes inifinite recursion in compiler
Labels: T-compiler,C-bug

<!--
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.
-->

I tried this code:

```rust
pub enum ObjectOrVec {
    Object(u8),
    V(Vec<ObjectOrVec>),
}

pub fn gen(gen_random_num: fn() -> u8) -> ObjectOrVec {
    use ObjectOrVec::*;
    fn gen_recursively(
        gen_random_num: fn() -> u8,
        recurses: usize,
        mut visitor: impl FnMut(ObjectOrVec),
    ) {
        match gen_random_num() {
            1 if recurses > 0 => {
                let mut v = Vec::new();
                gen_recursively(gen_random_num, recurses - 1, |x| v.push(x));
                visitor(V(v));
            }
            n => visitor(Object(gen_random_num())),
        }
    }

    let mut v = Vec::new();
    gen_recursively(gen_random_num, 3, |x| v.push(x));
    V(v)
}
```

I expected to see this happen: Code compiles and generates 2 versions of function `gen`.

Instead, this happened: compiler errors by reaching recursion limit. Increasing recursion limit causes stack overflow.

Error message:
```
error: reached the recursion limit while instantiating `gen_recursively::<{closure@src/lib.rs:16:63: 16:66}>`
  --> src/lib.rs:16:17
   |
16 |                 gen_recursively(gen_random_num, recurses - 1, |x| v.push(x));
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `gen_recursively` defined here
  --> src/lib.rs:8:5
   |
8  | /     fn gen_recursively(
9  | |         gen_random_num: fn() -> u8,
10 | |         recurses: usize,
11 | |         mut visitor: impl FnMut(ObjectOrVec),
12 | |     ) {
   | |_____^
```

Link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=571ea952b43ae93438a8f4bf9c2b0ec3

### Meta
<!--
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.
-->

`rustc --version --verbose`:
```
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-pc-windows-msvc
release: 1.81.0
LLVM version: 18.1.7
```
Repository: godot
Issue: Linux: Blender process not stopping on Godot-Exit
Labels: bug,platform:linuxbsd,topic:thirdparty

### Tested versions

Godot v4.3.stable

### System information

Godot v4.3.stable - KDE neon 6.1 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 (nvidia; 535.183.01) - AMD Ryzen 5 5500 (12 Threads)

### Issue description

After exiting Godot my Blender process stays alive. 
Below a sample output of `ps -ef | grep blender` after exiting Godot.

```
user     840681    1998  0 00:31 ?        00:00:01 /snap/blender/5374/blender --background --python-expr  import bpy, sys, threading from xmlrpc.server import SimpleXMLRPCServer req = threading.Condition() res = threading.Condition() info = None export_err = None def xmlrpc_server():   server = SimpleXMLRPCServer(('127.0.0.1', 6011))   server.register_function(export_gltf)   server.serve_forever() def export_gltf(opts):   with req:     global info     info = ('export_gltf', opts)     req.notify()   with res:     res.wait()   if export_err:     raise export_err   # Important to return a value to prevent the error 'cannot marshal None unless allow_none is enabled'.   return 'BLENDER_GODOT_EXPORT_SUCCESSFUL' if bpy.app.version < (3, 0, 0):   print('Blender 3.0 or higher is required.', file=sys.stderr) threading.Thread(target=xmlrpc_server).start() while True:   with req:     while info is None:       req.wait()   method, opts = info   if method == 'export_gltf':     try:       export_err = None       bpy.ops.wm.open_mainfile(filepath=opts['path'])       if opts['unpack_all']:         bpy.ops.file.unpack_all(method='USE_LOCAL')       bpy.ops.export_scene.gltf(**opts['gltf_options'])     except Exception as e:       export_err = e   info = None   with res:     res.notify()
```

### Steps to reproduce

* Open Godot Project, which uses Blender imports
* Close Godot and see the process list, i.e. `ps -ef | grep blender`

### Minimal reproduction project (MRP)

-
Repository: deno
Issue: deno run panics with BYONM if the main module specifies a dist tag and the package is in `node_modules`
Labels: bug

This was originally spotted because I tried to have npm version requirements default to the `latest` tag in `deno_semver`. While testing out the change in deno I ran into this panic. Outside of that setting, it's a little convoluted to encounter.

Repro:

Get `cowsay` into the node_modules dir
```
deno run --node-modules-dir=auto -A npm:cowsay
```
Then try to run it with BYONM, and a dist tag
```
❯ deno run --node-modules-dir=manual -A npm:cowsay@latest

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 2.0.0-rc.5
Args: ["deno", "run", "--node-modules-dir=manual", "-A", "npm:cowsay@latest"]

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_semver-0.5.13/src/lib.rs:284:32:
programming error: cannot use matches with a tag: latest
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Repository: vscode
Issue: SCM Graph - Unsure how to tell when graph is locked to a repository
Labels: ux,scm,under-discussion

Testing #229375

I noticed when I selected a specific repository for the SCM graph that the repository name next to the book icon changed, but that the branch icon still had the text "auto" next to it. Is there some indicator for when I have the SCM graph set to a specific repository versus when I have it set to auto?
Repository: transformers
Issue: llama `tie_word_embeddings` ignored on cpu and with auto dtype only
Labels: Core: Modeling,bug

### System Info

platform: linux: `ubuntu 22.04`
python version: `3.10.12`
transformers version: `4.44.2`

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [x] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

```python3
import torch
import pytest
from transformers import AutoModelForCausalLM

@pytest.mark.parametrize(
    "torch_dtype,tie_word_embeddings,device_map",
    [
        (torch.float16, False, "cpu"   ),  # passes
        (torch.float32, False, "cpu"   ),  # fails
        (torch.float32, False, "cuda:0"),  # passes

        (torch.float16, True, "cpu"   ),  # passes
        (torch.float32, True, "cpu"   ),  # passes
        (torch.float32, True, "cuda:0"),  # passes
    ],
)
def test_model_shared(torch_dtype, tie_word_embeddings, device_map, tmp_path):
    # load model
    model = AutoModelForCausalLM.from_pretrained(
        "Xenova/llama2.c-stories15M",
        torch_dtype=torch_dtype,
        tie_word_embeddings=tie_word_embeddings,
        device_map=device_map
    )

    # modify lm head
    with torch.no_grad():
        model.lm_head.weight += 1

    # check that embed_tokens is not modified
    if tie_word_embeddings:
        assert torch.equal(model.lm_head.weight, model.model.embed_tokens.weight)
    else:
        assert not torch.equal(model.lm_head.weight, model.model.embed_tokens.weight)
```

### Expected behavior

I expect tied tensors should not be tied if `tie_word_embeddings=False`. Instead, the tensors are tied. Seems to be the root cause of #33688
Repository: deno
Issue: deno add: wildcard version requirement doesn't match pre-release versions
Labels: bug

Split out from #25813,

Repro:

```
❯ deno add 'npm:storybook-solidjs-vite@*'
error: npm:storybook-solidjs-vite was not found.
```

Interestingly, most of the other subcommands (e.g. `deno run`) behave as expected
```
❯ deno run 'npm:storybook-solidjs-vite@*'
error: Failed resolving binary export. '/repro/node_modules/.deno/storybook-solidjs-vite@1.0.0-beta.2/node_modules/storybook-solidjs-vite/package.json' did not have a bin property
```
(there is no bin entrypoint, so this error is correct, the important bit is that it resolved to `1.0.0-beta.2`)
Repository: pytorch
Issue: support FakeTensor input for torch.compile
Labels: triaged,oncall: pt2,module: fakeTensor,module: dynamo,module: pt2-dispatcher

### 🚀 The feature, motivation and pitch

In AutoFSDP, I want to estimate flops and runtimes without running model on real GPUs (so I can explore best module wrapping policy without running large scale jobs). I was trying to use FakeTensor input for torch.compile. I got following error from `backend=inductor`: **fake mode from fake tensor input 0 allocated at...**.  

Wonder the workload to make it work? There are maybe 2 fake modes, one from my user code, and one from PT2 stack

If it helps triage, `backend=eager` works

repro
```
import torch
import torch.nn as nn
from torch._subclasses.fake_tensor import FakeTensorMode

with FakeTensorMode():
    model = nn.Linear(4, 4, device="cuda")
    inp = torch.rand(4, 4, device="cuda")
    loss = torch.compile(model)(inp).sum()
    loss.backward()
```

error stack
```
  File "/data/users/weif/pytorch/torch/_dynamo/symbolic_convert.py", line 983, in run
    while self.step():
  File "/data/users/weif/pytorch/torch/_dynamo/symbolic_convert.py", line 895, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/data/users/weif/pytorch/torch/_dynamo/symbolic_convert.py", line 2987, in RETURN_VALUE
    self._return(inst)
  File "/data/users/weif/pytorch/torch/_dynamo/symbolic_convert.py", line 2972, in _return
    self.output.compile_subgraph(
  File "/data/users/weif/pytorch/torch/_dynamo/output_graph.py", line 1117, in compile_subgraph
    self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
  File "/data/users/weif/pytorch/torch/_dynamo/output_graph.py", line 1360, in compile_and_call_fx_graph
    backend_fake_mode = torch._subclasses.FakeTensorMode(
  File "/data/users/weif/pytorch/torch/_subclasses/fake_tensor.py", line 1174, in __init__
    self._stack_trace = traceback.extract_stack()

fake mode from fake tensor input 0 allocated at:
  File "/data/users/weif/pytorch/test_fake_tensor_compile.py", line 5, in <module>
    with FakeTensorMode():
  File "/data/users/weif/pytorch/torch/_subclasses/fake_tensor.py", line 1174, in __init__
    self._stack_trace = traceback.extract_stack()
```

### Alternatives

_No response_

### Additional context

_No response_

cc @ezyang @chauhang @penguinwu @eellison @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @rec @zou3519 @bdhirsh
Repository: PowerToys
Issue: [Peek] Implement pre-loading of the Next/Previous image for ImagePreviewer
Labels: Needs-Triage

### Description of the new feature / enhancement

In the current Peek implementation, each time the user navigates to a new image, an entirely separate instance of the ImagePreviewer class is created, and then the image is loaded and displayed. This is fine for peeking single images or small files, but when navigating through a folder of large images, the constant loading is distracting. It would be advantageous to pre-load the Next or Previous image, so switching could be instantaneous when/if the user navigated in that direction.

Please note: this is separate from the #34515 issue, but it is likely that both will involve not destroying prior previewer instances between navigation events.

### Scenario when this would be used?

This would greatly speed up the transition between images when a user is navigating through images in a folder, making Peek appear more responsive. The benefit would only increase if those images were larger and required time to load and decode.

### Supporting information

Various dedicated image viewers like ACDsee, IrfanView and others have been doing this for many years, and it is a standard default feature in those applications.
Repository: pytorch
Issue: DistributedSampler shuffle option doesn't work as expected
Labels: module: dataloader,triaged

### 🐛 Describe the bug

When doing multi-GPU processing and using DistributedSampler, the shuffle=True setting results in some files in the dataset not being used on any of the GPU's. I found this when using the training script for evaluation and not turning off the shuffle. The expected number of output files written being lower than expected. I finally traced this to the fact that some of the dataset files were processed twice, and therefore those outputs were overridden, and some were not processed at all. Setting shuffle=False fixes the problem. This is an acceptable work around for evaluation, but it could have unintended consequences for training. 

Shuffle to me means that you are sampling without replacement. The behavior that I see is sampling without replacement for each GPU, but not across the GPU. That is, it is possible for different GPU to end up processing the same file.

Easy way to reproduce is to create a dataset equal to the number of GPU and printout which files each GPU is processing.

Pretty standard prepare DataLoader, only change is to allow different configurations for single vs. multiple GPUs. This code doesn't have the problem for evaluation because number of epochs for evaluation is always 1.

def prepare_dataloader(args, worldSize, dataset: Dataset, rng):
    if args.n_epochs == 1:
        shuffle_data = False # shuffling is not exclusive between GPU's which causes issues at evaluation
    else:
        shuffle_data = True
    if worldSize == 1:
        outLoader = DataLoader(
            dataset,
            batch_size=args.batch_size,
            num_workers=args.num_workers,
            pin_memory=True, 
            generator=rng,
            shuffle=True,
        )
    else:
        outLoader = DataLoader(
            dataset,
            batch_size=args.batch_size,
            num_workers=args.num_workers,
            pin_memory=True, 
            shuffle=False,
            sampler=DistributedSampler(dataset,num_replicas=worldSize,shuffle = shuffle_data)
        )
    return outLoader


### Versions

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.4.1
[pip3] torchaudio==2.4.1
[pip3] torchmetrics==1.4.2
[pip3] torchvision==0.19.1
[conda] libopenvino-pytorch-frontend 2024.4.0             hf9b8971_0    conda-forge
[conda] numpy                     1.26.4          py311h7125741_0    conda-forge
[conda] pytorch                   2.4.1                  py3.11_0    pytorch
[conda] torchaudio                2.4.1                 py311_cpu    pytorch
[conda] torchmetrics              1.4.2              pyhd8ed1ab_0    conda-forge
[conda] torchvision               0.19.1                py311_cpu    pytorch


cc @andrewkho @gokulavasan @SsnL @VitalyFedyunin @dzhulgakov
Repository: ui
Issue: [bug]: fails to update tailwind.config.ts properly in new remix app
Labels: bug

### Describe the bug

in a brand new remix app:
```sh
npx create-remix@latest my-app
```
After running the shadcn install command:
```sh
npx shadcn@latest init
```
It borks the `tailwind.config.ts` file. This is what you end up with. The `fontFamily.sans` is not being updated correctly. I think it has something to do with the quotes. Notice there is no beginning `"` in front of "Inter".
```ts
import type { Config } from "tailwindcss";

export default {
    darkMode: ["class"],
    content: ["./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}"],
  theme: {
  	extend: {
  		fontFamily: {
  			sans: [\n          'Inter"',\n          "ui-sans-serif",\n          "system-ui",\n          "sans-serif",\n          'Apple Color Emoji"',\n          'Segoe UI Emoji"',\n          'Segoe UI Symbol"',\n          'Noto Color Emoji"',\n        ]
  		},
  		borderRadius: {
  			lg: 'var(--radius)',
  			md: 'calc(var(--radius) - 2px)',
  			sm: 'calc(var(--radius) - 4px)'
  		},
  		colors: {
  			background: 'hsl(var(--background))',
  			foreground: 'hsl(var(--foreground))',
  			card: {
  				DEFAULT: 'hsl(var(--card))',
  				foreground: 'hsl(var(--card-foreground))'
  			},
  			popover: {
  				DEFAULT: 'hsl(var(--popover))',
  				foreground: 'hsl(var(--popover-foreground))'
  			},
  			primary: {
  				DEFAULT: 'hsl(var(--primary))',
  				foreground: 'hsl(var(--primary-foreground))'
  			},
  			secondary: {
  				DEFAULT: 'hsl(var(--secondary))',
  				foreground: 'hsl(var(--secondary-foreground))'
  			},
  			muted: {
  				DEFAULT: 'hsl(var(--muted))',
  				foreground: 'hsl(var(--muted-foreground))'
  			},
  			accent: {
  				DEFAULT: 'hsl(var(--accent))',
  				foreground: 'hsl(var(--accent-foreground))'
  			},
  			destructive: {
  				DEFAULT: 'hsl(var(--destructive))',
  				foreground: 'hsl(var(--destructive-foreground))'
  			},
  			border: 'hsl(var(--border))',
  			input: 'hsl(var(--input))',
  			ring: 'hsl(var(--ring))',
  			chart: {
  				'1': 'hsl(var(--chart-1))',
  				'2': 'hsl(var(--chart-2))',
  				'3': 'hsl(var(--chart-3))',
  				'4': 'hsl(var(--chart-4))',
  				'5': 'hsl(var(--chart-5))'
  			}
  		}
  	}
  },
  plugins: [require("tailwindcss-animate")],
} satisfies Config;
```

### Affected component/components

cli

### How to reproduce

1. `npx create-remix@latest my-app`
2. `cd my-app`
3. `npx shadcn@latest init`


### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
Remix 2.12.1
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: vscode
Issue: Undo stacks are not granular enough for Korean
Labels: bug,editor-input-IME,undo-redo

Testing #229383

Right now, typing a sentence in Korean and pressing undo will **remove the entire line**. I confirmed with a native Korean speaker that the ideal behavior for undo is to remove the last consonant/vowel (each character is made up of 2-4 consonants/vowels). This might be difficult to do depending on how EditContext words, but a little less better but much better than deleting the whole line is to delete the last fully formed character.

![Image](https://github.com/user-attachments/assets/f0b809a1-7862-45aa-98e4-b038ae36158e)

Note that this is not a regression, but it's a pretty bad existing great experience.