sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: MPS lgamma function changes results when using broadcasting
Labels: triaged,module: correctness (silent),module: mps

### 🐛 Describe the bug

When broadcasting a tensor to another shape, torch.lgamma on MPS yields different results for the same input value (when copying back and forth between CPU and MPS the correct values are yield):

```
from torch.distributions.utils import broadcast_all
import torch

b = torch.full((3, 10), 1., device='mps')
c = torch.full((3, 1), 1., device='mps')
b, c = broadcast_all(b, c)
torch.lgamma(b), torch.lgamma(c), torch.lgamma(b.to('cpu').to('mps'))
```
yields:
```
(tensor([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], device='mps:0'),
 tensor([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., inf, inf, inf, inf, inf],
         [inf, inf, inf, inf, inf, inf, inf, inf, inf, inf]], device='mps:0'),
 tensor([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
         [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], device='mps:0'))
```

### Versions

Collecting environment information...
PyTorch version: 2.5.0.dev20240803
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 13.1 (arm64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.202)
CMake version: Could not collect
Libc version: N/A

Python version: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ] (64-bit runtime)
Python platform: macOS-13.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M1 Max

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] numpyro==0.15.2
[pip3] pytorch-lightning==2.3.3
[pip3] torch==2.5.0.dev20240803
[pip3] torchaudio==2.4.0.dev20240803
[pip3] torchmetrics==1.4.1
[pip3] torchvision==0.20.0.dev20240803
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] numpyro                   0.15.2                   pypi_0    pypi
[conda] pytorch                   2.5.0.dev20240803        py3.11_0    pytorch-nightly
[conda] pytorch-lightning         2.3.3                    pypi_0    pypi
[conda] torchaudio                2.4.0.dev20240803       py311_cpu    pytorch-nightly
[conda] torchmetrics              1.4.1                    pypi_0    pypi
[conda] torchvision               0.20.0.dev20240803       py311_cpu    pytorch-nightly

cc @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen
Repository: godot
Issue: Run Project doesn't automatically focus the game window
Labels: bug,platform:linuxbsd,topic:editor,needs testing,regression

### Tested versions

- Tested in v4.3.rc2
- Not present in v4.2

### System information

Godot v4.3.rc2.mono - Ubuntu 24.04 LTS 24.04 - Wayland - Vulkan (Forward+) - integrated Intel(R) HD Graphics 4400 (HSW GT2) - Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz (4 Threads)

### Issue description

With v4.3 (rc2), running a project with `F5` or with the `Run Project` button, focus is not on the newly-created window, but on the Godot editor instead.
NOTE: Cannot reproduce consistently.

### Steps to reproduce

CANNOT REPRODUCE CONSISTENTLY.
*The display mode has to be set to `Exclusive Fullscreen` or `Fullscreen` according to my current tests*
Here's how I have gotten the bug to occasionally happen:
1. By upgrading a 4.2 project to 4.3, then immediately following the following steps:
     - Open a script file (to easily test focus). 
     - Run project (in any way).
     - Press `Enter` a few times
     - Go back to the editor view, and see if you typed any line breaks.
 2. Open a 4.3 project, then fullscreen it (`Shift + F11`).
     - Follow the above steps

### Minimal reproduction project (MRP)

N/A
Repository: PowerToys
Issue: Some weird keyboard grab, started with v0.83.0
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.83.0

### Installation method

PowerToys auto-update

### Running as admin

Yes

### Area(s) with issue?

General

### Steps to reproduce

A few hours ago I have updated powertoys, and restarted my computer.  A very annoying problem happened twice: using shift with the arrow keys was completely ignored.  Using them without shift, or with ctrl worked fine, broken only with shift.

The second time it happened I closed powertoys and that resolved it.  I then restarted it and it works fine now.

Some further details that are possibly relevant:
* I *do not* use the PT keyboard remapping tool.
* I *do* use autohotkey, so it might be some bad interaction with it, though I'd expect not to have any issues due to not using PT's keyboard thing.
* When it first happened, I tried some random stuff, including restarting my AHK script, and eventually the problem went away. On the second occurrence, that didn't work, and the next candidate to nuke in an attempt to find the offender was PT.

Sorry that I cannot provide more information; I will add more if/when I run into it again.

### Other Software

List of other tools that I'm using that could have lead to a bad interaction:
* Autohotkey
* VS Code
* X410
Repository: transformers
Issue: Tutorial for using DeepSpeed's activation checkpointing instead of PyTorch's
Labels: Feature request,DeepSpeed

### Feature request

Is there a tutorial for using DeepSpeed's activation checkpointing instead of PyTorch's?

I'm using `Trainer` with ZeRO integration to train my model. Here's my code:

```python
if training_args.deepspeed_gradient_checkpointing and training_args.deepspeed:
        from deepspeed.runtime.activation_checkpointing.checkpointing import configure
        configure(mpu_=None)
        from deepspeed.runtime.activation_checkpointing.checkpointing import checkpoint
        model._set_gradient_checkpointing(training_args.deepspeed_gradient_checkpointing, checkpoint)
```

```json
{
"activation_checkpointing": {
    "partition_activations": true,
    "cpu_checkpointing": true,
    "contiguous_memory_optimization": false,
    "number_checkpoints": null,
    "synchronize_checkpoint_boundary": false,
    "profile": false
  }
}
```

```shell
torchrun --nproc_per_node=8 \
    --nnodes=${NNODES} \
    --node_rank=${NODE_RANK} \
    --master_addr=${MASTER_ADDR} \
    --master_port=${MASTER_PORT} \
    train.py \
    --deepspeed ${DEEPSPEED_CONFIG_PATH} \
    --gradient_checkpointing False
```

However, I got this in FlashAttention2:

```
class XXXFlashAttention2(XXXAttention):
    def forward(
        self,
        hidden_states: torch.Tensor,
        attention_mask: Optional[torch.LongTensor] = None,
        position_ids: Optional[torch.LongTensor] = None,
        past_key_value: Optional[Cache] = None,
        output_attentions: bool = False,
        use_cache: bool = False,
        cache_position: Optional[torch.LongTensor] = None,
        **kwargs,
    ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
        output_attentions = False

        bsz, q_len, _ = hidden_states.size()  # <---- this got error

        query_states = self.q_proj(hidden_states)
        key_states = self.k_proj(hidden_states)
        value_states = self.v_proj(hidden_states)
```

```
  File "modeling_xxx.py", line 518, in forward
    bsz, q_len, _ = hidden_states.size()
ValueError: not enough values to unpack (expected 3, got 2)
```

### Motivation

It seems there isn't such a tutorial available at the moment in either [deepspeed](https://deepspeed.readthedocs.io/en/latest/activation-checkpointing.html)'s tutorial or [huggingface](https://huggingface.co/docs/transformers/v4.43.3/en/deepspeed#activationgradient-checkpointing).

### Your contribution

Provide my results
Repository: vscode
Issue: Allow Extensions to contribute User Profile Templates
Labels: feature-request,user-profiles

<!-- ⚠️⚠️ 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. -->
Seems that currently all User Profile Templates shown here are [built-in](https://code.visualstudio.com/docs/editor/profiles#_profile-templates) predefined templates. 
![image](https://github.com/user-attachments/assets/9494df6f-9a6a-4378-bd10-9531ccb173a8)

It would be better if a vscode extension can contribute some custom user profile templates. This feature can also combine with "extension pack" that not only [shares extensions](https://code.visualstudio.com/blogs/2017/03/07/extension-pack-roundup#_why-would-i-want-to-create-an-extension-pack) but also some useful settings, tasks, etc.

Btw this could be an alternative suggestion to #181553 . Because we can now install extensions by CLI and if we allow a extension to provide profile template, it will be easier to deploy profiles in those scenario.
Repository: godot
Issue: Godot wrongly detects presence of Animation Tracks when deleting multiple scenes
Labels: bug,topic:editor,needs testing,topic:animation

### Tested versions

v4.3.rc2.official [3978628c6]
(was also happening in 4.1 but didn't report it back then)

### System information

Mac Mini M1 with newest MacOS

### Issue description

Sometimes, when deleting multiple selected scenes that contain other scenes (but not Animation Tracks), Godot offers to delete related Animation Tracks even though there are none:
![image](https://github.com/user-attachments/assets/39e7c223-ccc9-4229-9932-48b1894c33bf)

I never answer "Yes" to these prompts because I can't know whether a random Animation Track somewhere in the project will really get deleted. Just as a test I made a copy of a project where I managed to trigger this false detection every time and answered "Yes" just to see what'll happen, but didn't notice anything unusual (the scenes that were selected were simply deleted), but who knows whether this is what always happens.

If I delete the same scenes one by one, no false warnings appear.

### Steps to reproduce

Select a few scenes of "certain complexity" (without any Animation Tracks) and hit delete. A warning will appear.

### Minimal reproduction project (MRP)

It looks like it's related to the complexity of the scene or the size of the project so I was not able to reproduce it isolated.

I assume it must be super simple to reproduce it but I didn't manage. If someone from the Godot team wants me to send a simple private project where this appears I'll be happy to do so, I have a case where this is 100 % reproducible.
Repository: go
Issue: proposal: x/crypto/ssh: v2
Labels: Proposal,Proposal-Crypto

### Proposal Details

In #65269 we discussed migrating the `x/crypto` packages and thus also `x/crypto/ssh` to the standard library and the proposal was accepted.

The package `x/crypto/ssh` is one of the most used package in `x/crypto` and so it is stable and works well.
However, over the years we have accumulated several sub-optimal implementations to keep backward compatibility and we have realized that some interfaces are not implemented outside the packages itself and therefore can be removed.

The ssh server implementation does not have a high-level API similar to net/http `ListenAndServe` and is therefore not consistent with user expectations.

Furthermore, to have more consistency with the standard library APIs, we should rewrite the API that returns Go channels.

In v2 we can also remove deprecated API (e.g. DSA support).

In general, for client and server APIs we want to have both a high-level and a low-level API to provide an easy way to handle the most common use cases, but also to enable our users to handle more advanced use cases by using the low-level API.

I propose to first add a v2 to x/crypto and then move this version to the standard library. Design doc will follow.
Repository: godot
Issue: Microphone plays its buffer in an infinite loop on Android when re-enabled
Labels: bug,platform:android,topic:audio

### Tested versions

4.3.rc2

### System information

Android version 13

### Issue description

AudioStreamMicrophone can play its buffer in an infinite loop when it has been turned off and then turned back on.  I used to encounter this intermittently, but it is now completely reproducible in a small project.

I tried it in v4.2.1.stable, but here it just keeps switching off after less than a second, so is probably this issue: https://github.com/godotengine/godot/issues/86428  The switching off still happens in v4.3.rc2 but not so quickly.

The following video was recorded off my Android phone as a demo.
https://github.com/user-attachments/assets/bfeea975-3386-4d54-a8ea-9941cf62b250

### Steps to reproduce

Make an AudioStreamPlayer with an AudioStreamMicrophone, set to Autoplay.  Then while it's running call stop() and then play() and the output to the Bus will be a ~0.5second loop of a fragment of recording.  (Only happens on Android.)

### Minimal reproduction project (MRP)

[lipsyncapp2.zip](https://github.com/user-attachments/files/16486947/lipsyncapp2.zip)
Repository: vscode
Issue: BUG: editor.cursorBlinking: Cursor stops blinking after 10 blinkings (seconds) and remain visible
Labels: bug,editor-core

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
Version: 1.92.0
Commit: b1c0a14de1414fcdaa400695b4db1c0799bc3124

Steps to Reproduce:

1. Set settings to
![зображення](https://github.com/user-attachments/assets/ce85f022-7f90-420d-a02b-60aa977be849)

2. Open new text file
![зображення](https://github.com/user-attachments/assets/9de2764f-57a8-4ca9-a655-0f7831c230c1)

3. Cursor stops blinking after 10 blinkings (seconds) and remain visible
![зображення](https://github.com/user-attachments/assets/a81c7530-5c33-4c51-ba12-1730f4c3b286)
Repository: rust
Issue: bootstrap: sccache has no effect / RUSTC_WRAPPER not used? 
Labels: T-bootstrap,C-bug

b389b0ab72cb0aa9acf4df0ae0c0e12090782da9

It seems that when doing a `x.py build` or `check`, `RUSTC_WRAPPER` is no longer used, so all calls go directly to `rustc` and not `sccache rustc` which would allow caching through sccache?

When building rustc, I could see that the sccache was neither utilized (no cache hits) nor fed with new artifacts (no cache misses)
Repository: node
Issue: can't execute /dev/stdin on linux
Labels: confirmed-bug,linux

### Version

v22.5.1

### Platform

```text
Linux archlinux 6.10.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +0000 x86_64 GNU/Linux
```


### Subsystem

_No response_

### What steps will reproduce the bug?

```sh
printf 'console.log(1)' | node /dev/stdin
```

### How often does it reproduce? Is there a required condition?

every time

### What is the expected behavior? Why is that the expected behavior?

```
1
```

### What do you see instead?

```js
node:fs:453
    return binding.readFileUtf8(path, stringToFlags(options.flag));
                   ^

Error: ENOENT: no such file or directory, open '/proc/2513530/fd/pipe:[611889]'
```

### Additional information

related so problem https://stackoverflow.com/q/77488707/13040423
Repository: PowerToys
Issue: Powertoys run calculator weird behavior with space-separated thousands
Labels: Issue-Bug,Idea-Enhancement,Help Wanted,Product-PowerToys Run,Cost-Small,Run-Plugin

### Microsoft PowerToys version

0.83.0

### Installation method

PowerToys auto-update

### Running as admin

No

### Area(s) with issue?

PowerToys Run

### Steps to reproduce

1. Open powertoys run
2. Type in `100 500/100` - the result is incorrect (`500` instead of `1005`)
3. If we type in `100500/100` (without the separator), we get the correct result - `1005`.

I believe this is because the whitespace will be treated as implied multiplication, so the equation becomes `100(500/100) = 500`


### ✔️ Expected Behavior

Whitespace can be used for thousands separator. 

According to [Wikipedia](https://en.wikipedia.org/wiki/Decimal_separator#:~:text=1%29%20Space%2C%20the%20internationally%20recommended%20thousands%20separator.), space is the internationally recommended thousands separator.

### ❌ Actual Behavior

Doing calculations with large numbers formatted with whitespace as thousand separator give misleading results.

### Other Software

_No response_
Repository: ollama
Issue: Bunny family of VLMs
Labels: model request

Bunny is a family of very promising VLMs.  They are already supported by llama.cpp

https://github.com/BAAI-DCAI/Bunny

v1.1 4b: https://huggingface.co/BAAI/Bunny-v1_1-4B
v1.1 llama3 8b:  https://huggingface.co/BAAI/Bunny-v1_1-Llama-3-8B-V
Repository: pytorch
Issue: topk with mask - efficent
Labels: module: performance,triaged,module: sorting and selection,module: masked operators

### 🚀 The feature, motivation and pitch

topk operation is important for many domains, but still suffer from high complexity.
(espically regards in the LLM domain)
Suppuse you get an input with a coresponding binary mask; where you need to find the topk only on the mask.

The goal is not to get correcntess but to get efficentcy.  Where the complexity should be affacted by the mask.
It seems that the current implmentation cannot take this advantage.
I can be great if we can have such advaced topk operation.

### Alternatives

_No response_

### Additional context
note: I have considered to get into that issue, but it seems that there is a need to edit both cpp+cuda versions.
where i did not find documntation.

_No response_

cc @msaroufim
Repository: godot
Issue: First Godot instance blocks LSP port from other instances forever
Labels: bug,discussion,topic:gdscript,topic:editor

### Tested versions

reproducible in 
- Godot v4.3.rc2.mono
- Godot v4.3.rc1.mono

### System information

Godot v4.3.rc2.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 32.0.15.5599) - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 Threads)

### Issue description

It seems that the first Godot instance prevents other Godot instances running at the same time from never opening the LSP port even if the first Godot instance is closed.

Reloading current project or restarting Godot fixes this problem and vscode will be able to connect. However the default value of reconnect attempts is only 10 so it is more than likely that vscode has already stopped the reconnection attempts before the user has fixed the Godot side of the problem. (Personally I have changed the vscode reconnection attempt setting to 100 and that has saved me from many restarts.)

### Steps to reproduce

1. Start Godot instance 1 
1. Start Godot instance 2
1. Close Godot instance 1 
1. Start vscode 
1. -> vscode cannot connect to the LSP of the remaining Godot instance 2

If the Godot instance 2's project is reloaded, vscode is able to connect.

### Minimal reproduction project (MRP)

N/A
Repository: pytorch
Issue: bitwise_xor seems to be not optimized
Labels: module: performance,triaged,module: python frontend

### 🚀 The feature, motivation and pitch

Recently, I have analyzed time complexity a of simple matrix maltiplication to "matrix_xor".
(this is a kind of approximation that i am doing, but it is not the point), the point is the time complexity analyze itseft.

*The matrix opeation is:
(1) B, H, L, dim = 5, 12, 1024, 64
(2) x1 = torch.randn((B, H, L,dim), device='cuda')
(3) x2 = torch.randn((B, H, L, dim), device='cuda')
(4) res1 = torch.matmal(x1, x2.traspose(-2,-1))

with this operation each entry has about mul&add of floats O(dim)

*The "matrix xor" opeation is:
I compared (4) t to a case where each entry is single xor operations. that is:
(5)  x1 = torch.randint(2 ** 32, (B, H, L,1), device='cuda')
(6) x2 = torch.randint(2 ** 32, (B, H, 1, L), device='cuda')
(7) res2 = torch.bitwise_xor(x1,x2)

Each entry has one operation of xor (int)

Comparing time complexity only of (4) vs (7), show very small advantage to the bitwise_xor.
Although this is single xor vs  #dim of mul&add!

I thought that it should to be much faster with about ~dim, but it gives my very thin speedup of 1.5 which is very dissapointing.
It seems that the bitwise_xor within torch is not optimize, and it can be good to optimize.
thanks!

### Alternatives

_No response_

### Additional context

_No response_

cc @msaroufim @albanD