sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: transformers
Issue: Improve Guidance for Using DDP in `examples/pytorch`
Labels: Feature request

### Feature request

The examples in `examples/pytorch/` (e.g., [semantic-segmentation](https://github.com/huggingface/transformers/tree/main/examples/pytorch/semantic-segmentation)) would benefit from clearer guidance on how to use Distributed Data Parallel (DDP) in trainer version. 

### Motivation

I modified the training script from [run_semantic_segmentation.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/semantic-segmentation/run_semantic_segmentation.py) for my task, and it worked well on one or two GPUs. However, when scaling to four GPUs, training became significantly slower. After several days of debugging, I realized that the default example in `README.md` does not use `accelerate` or another distributed launcher, which meant the script was running with Data Parallel (DP) instead of DDP the entire time.  

The default command of trainer version provided in the `README.md` is:  
```bash
python run_semantic_segmentation.py \
    --model_name_or_path nvidia/mit-b0 \
    --dataset_name segments/sidewalk-semantic \
    --output_dir ./segformer_outputs/ \
    --remove_unused_columns False \
    --do_train \
    --do_eval \
    --push_to_hub \
    --push_to_hub_model_id segformer-finetuned-sidewalk-10k-steps \
    --max_steps 10000 \
    --learning_rate 0.00006 \
    --lr_scheduler_type polynomial \
    --per_device_train_batch_size 8 \
    --per_device_eval_batch_size 8 \
    --logging_strategy steps \
    --logging_steps 100 \
    --eval_strategy epoch \
    --save_strategy epoch \
    --seed 1337
```

To enable DDP, the command needs to be modified as follows:  
```bash
accelerate launch run_semantic_segmentation.py \
    --model_name_or_path nvidia/mit-b0 \
    --dataset_name segments/sidewalk-semantic \
    --output_dir ./segformer_outputs/ \
    --remove_unused_columns False \
    --do_train \
    --do_eval \
    --push_to_hub \
    --push_to_hub_model_id segformer-finetuned-sidewalk-10k-steps \
    --max_steps 10000 \
    --learning_rate 0.00006 \
    --lr_scheduler_type polynomial \
    --per_device_train_batch_size 8 \
    --per_device_eval_batch_size 8 \
    --logging_strategy steps \
    --logging_steps 100 \
    --eval_strategy epoch \
    --save_strategy epoch \
    --seed 1337
```

While this might be obvious to experienced users, it can be misleading for new users like me, as the default command seems to imply it works efficiently across any number of GPUs.  

### Your contribution

To address this, we could include a note or alert in the `README.md`, highlighting that to use DDP with the Trainer, it is necessary to replace `python` with `accelerate launch`, `torchrun`, or another distributed launcher. This would greatly improve clarity for beginners and help avoid confusion.
Repository: pytorch
Issue: torch.export treats two of the same parameters as the same node
Labels: oncall: pt2,oncall: export

### 🚀 The feature, motivation and pitch

`torch.export` where the same tensor is used for multiple args in the example inputs, e.g. (self.x, self.x) results in a confusing graph where the two parameters seem to be treated as the same node. As a basic example, when I would pass in something like ep.module()(torch.zeros(10), torch.ones(10)) as example inputs for the export, when tracing through the exported graph, for ops where I am expecting the arg to be the first parameter, torch.zeros(10), it takes the second parameter, torch.ones(10).

Discussed with @angelayi and we think that this should be expected behavior, since it is a valid use case that the two parameters passed in are references to the same object, in which case it would make sense for them to share a node in the graph. However, my case was that both are possible - they could refer to the same object in some scenarios and different objects in others. To capture this dual use case we would need to pass in the latter as example input instead of the former. We think it would be useful thought to add a warning log about this behavior.

### Alternatives

_No response_

### Additional context

_No response_

cc @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4
Repository: angular
Issue: Certain `@let` values can mimic internal data structure, breaking basic runtime logic
Labels: area: core,state: has PR,P2,bug

### Which @angular/* package(s) are the source of the bug?

core

### Is this a regression?

Yes

### Description

Before hydration and using signals my code worked. I refactored it to use signals and incremental hydration and it broke. The error message was not really meaningful: `Cannot add property i18nNodes, object is not extensible`

I use [apollo-angular](https://www.npmjs.com/package/apollo-angular) which freezes every object in its state and results. The state cannot be modified.

### Please provide a link to a minimal reproduction of the bug

_No response_

### Please provide the exception or error you saw

```true
Cannot add property i18nNodes, object is not extensible

The line where the error has happened is https://github.com/angular/angular/blob/4491704fbaec02db8eec5845ffbb200dbf2a0bf6/packages/core/src/hydration/i18n.ts#L660
```

### Please provide the environment you discovered this bug in (run `ng version`)

```true
NX 20.3.0
Angular 19.0.5
Angular SSR 19.0.6
```

### Anything else?

Workaround:

Unfreeze the object using some hacky js code: `const unfrozenObj = JSON.parse(JSON.stringify(obj));`

Possible solutions:
Check before trying to set the values if the object is frozen using: `Object.isExtensible(object)`.
1. Throw an error that the state is not extensible and provide some information on the current component which has the error.
2. Show a warning during development and provide some information on the current component which has the error. In production mode ignore it.
3. Ignore setting the values without any warning.

I am very happy to code and make a PR on any of the solutions if the Angular team has decided.
Repository: transformers
Issue: FA2 support for Aria
Labels: Vision,Flash Attention,Multimodal

Currently, Aria does not support FA2 in its modeling code: https://github.com/huggingface/transformers/blob/2fa876d2d824123b80ced9d689f75a153731769b/src/transformers/models/aria/modeling_aria.py#L656 
However the reference checkpoint for the Aria model does set `attn_implementation` to FA2: https://huggingface.co/rhymes-ai/Aria/blob/104c6548d7da08fc3a30c4232d35cc9fb3239942/config.json#L36 

So the modeling code on transformers side should be updated to support it. It currently causes errors on the CI and I think it's due to this mismatch. 

cc @aymeric-roucher @zucchini-nlp
Repository: rust
Issue: Handling of legacy-incompatible paths by `PathBuf::push` on Windows
Labels: O-windows,T-libs-api,A-io,C-discussion

Should `pathbuf.push()` on Windows convert legacy paths to UNC syntax when they exceed the `MAX_PATH` length, or other limits?

Legacy MS-DOS (non-UNC) paths should not exceed `MAX_PATH` length (~260 chars) and have other syntactic limitations. Windows has partial, opt-in support for longer legacy paths, but not all APIs and not all applications support long legacy paths.

Windows has *extended-length* paths that start with a `\\?\` (UNC)  prefix. They are Microsoft's preferred way of specifying long paths. They can be 32KB long, and don't have path handling quirks inherited from MS-DOS. However, the UNC paths are not properly supported by many Windows applications #42869.

This question is related to `fs::canonicalize()` that currently returns UNC paths even when not necessary. `fs::canonicalize()` would be more compatible with Windows apps if it returned legacy paths whenever possible (when they fit under `MAX_PATH` and meet other restrictions like reserved names). However, the legacy paths have the length limit, so whether `fs::canonicalize(short_path).push(very_long_path)` works as expected depends on which syntax `fs::canonicalize` uses, or whether `path()` will correct the syntax if necessary.

Currently `push()` does not convert between legacy and UNC paths. If a `push()` causes a legacy path to exceed the limit, the path will keep using the legacy syntax, and technically won't be valid in APIs/apps that have the `MAX_PATH` limit. This is a simple, predictable implementation, but arguably makes it possible for `push()` to create an invalid path, a syntax error.

Besides the length limit, there are issues with reserved file names and trailing whitespace. `legacy_path.push("con.txt")` makes *the whole path* parse as a device name only, but `unc_path.push("con.txt")` simply appends the `con.txt` file name to the path as expected. Is this a bug in `push()`? Should `push` be a leaky abstraction that exposes quirks of how Windows parses legacy paths, or should `push()` switch to the less common UNC path syntax when it's necessary to precisely and losslessly append the given path components?

If `push()` converted paths to UNC whenever they exceed limits of legacy paths, then `push()` would be more robust, and semantically closer to `push()` on Unix that always appends components, rather than pushing characters that may cause the whole path to parse as something else, or get rejected entirely for not using a syntax appropriate for its length.
Repository: kubernetes
Issue: AWS EC2 Scale Tests are failing due to elevated latencies for API calls 
Labels: sig/scalability,kind/failing-test,needs-triage,sig/etcd

### Which jobs are failing?

- ec2-master-scale-performance 

### Which tests are failing?

ClusterLoaderV2 load tests

### Since when has it been failing?

Failing since Jan 02/2025

### Testgrid link

https://testgrid.k8s.io/sig-scalability-aws#ec2-master-scale-performance 

### Reason for failure (if possible)

_No response_

### Anything else we need to know?

_No response_

### Relevant SIG(s)

/sig scalability
Repository: godot
Issue: Cinematic Preview makes the editor redraw continuosly
Labels: topic:editor,needs testing,performance

### Tested versions

- Reproducible in 4.3 stable and latest master v4.4.dev (d79ff848f)

### System information

Godot v4.4.dev (d79ff848f) - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 threads)

### Issue description

When you activate the Cinematic Preview in the 3D editor, the editor will keep redrawing even without any moviment/change in the screen. Disabling the Cinematic Preview stops the redrawings.

### Steps to reproduce

- Go to the 3D editor.
- Click on `Prespective > Cinematic Preview`.
- Notice how the redraw cicle will spin nonstop even without any change in the editor.

### Minimal reproduction project (MRP)

N/A
Repository: flutter
Issue: Flutter Web generating infinite <style> tags
Labels: framework,platform-web,P1,team-web,triaged-web

### Steps to reproduce

I'm not sure how to reproduce, but deck.blue is a Flutter Web app that handles lots of images at the same time. @kevmoo suspects it has to do with <style> tags from those images. All I know is that it's happening on Chrome, Windows.

### Expected results

No additional <style> tags should be appearing in the DOM

### Actual results

600+ <style> tags are being generated somewhat randomly, source: [Bluesky post](https://bsky.app/profile/oleschri.localfluff.space/post/3lfm3iokt6f2q)

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: ListView(
            children: [      
Image.network('https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:ikvaup2d6nlir7xfm5vgzvra/bafkreib533tnnypa3wpbtlbdopwkmrg67cuhjhx5i7ymjho7k6z6jjoa2y@jpeg'),
Image.network('https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:knj5sw5al3sukl6vhkpi7637/bafkreiagaodlyvzjreilwji6ixondwrg22sqgker2cbcg3r7622xtpy3gy@jpeg' ),
Image.network('https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:fqz767ikcbgk7yifapygtxeh/bafkreibcnq7kkdnmulwbk5sytfb6tsgmfi6glbrov2c3q6sivndmaablgi@jpeg'),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![Image](https://github.com/user-attachments/assets/6ff834c2-c730-44c9-8a08-d354ff566450)

</details>


### Logs

<details open><summary>Logs</summary>

```console
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on macOS 14.7 23H124 darwin-arm64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.96.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
```

</details>
Repository: godot
Issue: Godot silently overwriting external (git) changes upon Running project, even when choosing 'reload'
Labels: topic:editor,needs testing

### Tested versions

Tested versions: I've had it happen from 4.0 to 4.2.2


### System information

Godot v4.2.2.stable.mono (15073afe3) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti (NVIDIA; 32.0.15.6094) - AMD Ryzen 5 5600 6-Core Processor (12 Threads)

### Issue description

Related to #62258

Sometimes there will be a popup asking to choose which version of the file to keep, choosing reload here - If I'm understanding it correctly, should drop Godot's cached version and reload the file from disk - but it actually writes Godot's cached data to the file when the scene is saved, even though the scene visually looks reloaded. Maybe displayed data is reset but internal data isn't?

### Steps to reproduce



To recreate it, you need to download a repo on two machines, then push a resource uid or signal connection change to some scene. On the other machine, if the scene is closed pulling will work fine - but if it's open in the editor, the bug will occur when you save or run the project.

### Minimal reproduction project (MRP)

It's not possible to reproduce with one project because the issue usually occurs when two computers with the repo have different files that are open in the editor when pulling. This leads to these files constantly ping-ponging changes. Godot never acknowledges discarding the change when it happens with files that are 'always open' like theme files.
Repository: go
Issue: x/tools/gopls: render package documentation when hovering over imported package name identifiers
Labels: help wanted,FeatureRequest,gopls

**Is your feature request related to a problem? Please describe.**
Package-level description isn't rendering

**Describe the solution you'd like**
I'd like the package-level description to render when hovering over an imported package, as shown in the screenshots below. ChatGPT suggests that if a package is spread across multiple files, Go uses first (alphabetically) nonempty comment, but I'm not totally sure. I don't know if VSCode is just getting confused.

**Describe alternatives you've considered**
One option is to ignore it. Another is to use GoLand. Another is to just always have the docs up

**Additional context**

### GoLand
I know the docs are there. They're in doc.go, and they're rendering in Godoc, and they're showing in GoLand

https://pkg.go.dev/go.temporal.io/sdk@v1.31.0/workflow#Go

<img width="1474" alt="Screenshot 2025-01-10 at 4 01 35 PM" src="https://github.com/user-attachments/assets/19c43723-3995-4727-a0cf-fd98d6adeef1" />


<img width="934" alt="docs-are-in-doc-dot-go" src="https://github.com/user-attachments/assets/c47f605e-a9c4-4b48-8c99-a172eb257f1f" />

<img width="1617" alt="Using-GoLand" src="https://github.com/user-attachments/assets/82ec3635-390d-4ce1-a909-92ee347d41ce" />

### VSCode

<img width="624" alt="Using-vscode" src="https://github.com/user-attachments/assets/ebf82a7c-5133-40ac-af8d-df5fd70450f9" />
Repository: pytorch
Issue: topK for sparse Vectors
Labels: module: sparse,triaged

### 🚀 The feature, motivation and pitch

Hello, Thanks for this great package. is it possible to have topk with sparse vectors ? 

Thanks 

### Alternatives

_No response_

### Additional context

_No response_

cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer @jcaip
Repository: langchain
Issue: with structured output gives error when using openai model but not anthropic or others.
Labels: investigate,Ɑ:  core

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

def QuestionRouter (state) :
        class RouteQuery(BaseModel):
            """Route a user query to the most relevant datasource."""

            route: Literal["search", "ordinary"] = Field(
            ...,
            description="Given a user question choose to route it to a tool or a ordinary question.",
        )
        
        
        print ("\n Inside Question Router") 
        structured_llm_router = llm.with_structured_output(RouteQuery)


### Error Message and Stack Trace (if applicable)

Failed to use model_dump to serialize <class 'pydantic._internal._model_construction.ModelMetaclass'> to JSON: TypeError("BaseModel.model_dump() missing 1 required positional argument: 'self'")
Failed to use dict to serialize <class 'pydantic._internal._model_construction.ModelMetaclass'> to JSON: TypeError("BaseModel.dict() missing 1 required positional argument: 'self'")
Hello! How can I assist you with insurance broking servicesFailed to use model_dump to serialize <class 'pydantic._internal._model_construction.ModelMetaclass'> to JSON: TypeError("BaseModel.model_dump() missing 1 required positional argument: 'self'")


### Description

using langchain + langgraph
Works perfectly with anthropic, groq etc
Issue is only visible with openai models

### System Info

python 3.12.6
Repository: PowerToys
Issue: Quick Accent not properly working when using on-screen keyboard
Labels: Issue-Bug,Priority-1,Area-Accessibility,Product-Quick Accent

### Microsoft PowerToys version

0.87.1

### Installation method

Microsoft Store

### Running as admin

Yes

### Area(s) with issue?

Quick Accent

### Steps to reproduce

1 Enable Quick Accent
2 Launch on-screen keyboard
3 Open word (or other text input application)
4 Use your mouse to click on a character using the onscreen keyboard e.g."a" and simultaneously click on spacebar or one of the arrow keys to launch the Quick Accent tool.
5 the Quick Accent tool is launched correctly but the character is inserted in multitudes (as long as one interacts with the Quick Accent tool).

### ✔️ Expected Behavior

Same as with using the physical keyboard, I expect the character not to be inserted in multitudes/but a single time. 

One might wonder when/how someone would enable this feature when using the on-screen keyboard given that the spacebar or arrow keys can not be triggered at the same time using the onscreen keyboard. However, the adaptive accessories allows someone to program the arrow keys to a physical button. In fact, I am helping a user who would greatly benefit from fixing this bug.

### ❌ Actual Behavior

The Quick Accent menu can be triggered but the character is inserted in multitudes/as long as the Quick Accent menu is active.

In the video I select the arrow keys on my physical keyboard to mimic triggering the Accent Tool with the button using the adaptive hub. I have confirmed actually doing this with the hub and external button gives the same result as reproducing it using the arrow keys on the keyboard.

https://github.com/user-attachments/assets/d4866bcc-d5b5-4228-80ba-4e45e62c7e97

### Other Software

_No response_
Repository: pytorch
Issue: DISABLED test_tcp (__main__.WorkerServerTest)
Labels: oncall: distributed,module: rocm,triaged,skipped

Platforms: rocm

This test was disabled because it is failing on main branch ([recent examples](https://torch-ci.com/failure?failureCaptures=%5B%22distributed%2Felastic%2Ftest_control_plane.py%3A%3AWorkerServerTest%3A%3Atest_tcp%22%5D)).

There is some setup issue with the ROCm CI self-hosted runners that blocks this port.  Need to investigate further, but disable for now to improve the CI signal.

cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd
Repository: pytorch
Issue: Support new CUDA conda package layout natively in cpp_extension.CUDAExtension
Labels: module: cpp-extensions,module: cuda,triaged,enhancement

### 🚀 The feature, motivation and pitch

[`torch.utils.cpp_extension.CUDAExtension`](https://pytorch.org/docs/stable/cpp_extension.html#torch.utils.cpp_extension.CUDAExtension) is designed to simplify compiling extension modules that require CUDA. To facilitate CUDA usage, it adds library/include/etc paths and passes them along to setuptools. These paths are currently based on the standard layout for CUDA packages provided via standard package managers (e.g. for Linux distros). However, as of CUDA 12 this is not the layout when CUDA is installed via conda packages. Recent updates to the CUDA infrastructure on conda-forge have added support for compiling CUDA code using compilers installed from CUDA (which was previously not possible). Since conda environments need to support cross-compilation, the packages are installed into a splayed layout where all files are placed into a `${PREFIX}/targets` directory and only a subset of them are symlinked directly into normal directories. In particular, shared libraries are symlinked into  `${PREFIX}/lib`, but the includes are not linked into `${PREFIX}/include` because instead the nvcc compiler in conda is configured (via nvcc.profile and environment variables) to know where to search for includes. As mentioned above, supporting cross-compilation in conda environments was a key point in these decisions (some discussion started in https://github.com/conda-forge/cuda-nvcc-feedstock/issues/12, happy to point to more threads if needed).

It would be ideal for PyTorch to also support compilation in these environments. To do so, the extension would need to also start searching these additional directories.

### Alternatives

At the moment this issue may be worked around by setting [`CUDA_INC_PATH`](https://github.com/pytorch/pytorch/blob/main/torch/utils/cpp_extension.py#L1240), so this issue is primarily to document a nice-to-have feature as well as to have something to point to in case future users encounter confusion around building extensions with pytorch inside modern conda environments.

### Additional context

_No response_

cc @malfet @zou3519 @xmfan @ptrblck @msaroufim @eqy
Repository: ollama
Issue: Running the same model on all GPUs
Labels: feature request,gpu

Is it possible to run the same model on multiple GPUs?
I have a server with 5 GPUs, and I want to run the same model on each GPU to provide more concurrency for users.
I found a solution by running multiple instances of "ollama serve" on different ports and using "haproxy" as a load balancer to distribute requests across the instances.
If this feature is not implemented, could you add an option to run the model on all or specific GPUs?

For example:
ollama run --gpus=all mistral
or
ollama run --gpus=0,1,2 mistral