sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: ollama
Issue: Ollama not respecting structured outputs with some ordering of refs
Labels: bug

### What is the issue?

The following program fails, but should work. 

Changing the `schema = ...` line to use `schema_works`, which is a slightly different schema, works. The two schemas should parse the same JSON - the only difference is the ordering in `"$defs"`.

I also have examples of pydantic-generated schemas which fail because of this bug.

It looks like the `json_schema_to_grammar` implementation has a "binding problem", that is it binds a def in `_refs` before visiting it, expecting a `"input#...` prefix, and consequently generates an incorrect grammar.

```python
from ollama import chat
import json
from jsonschema import validate, ValidationError

#
# Schema originally generated by pydantic. Depending
# on the alphabetical order of the names of the classes,
# both failing and working schemas can be generated.
# This is the smallest example I could find, and
# I'm using client version is 0.5.5.
#
# The *only* difference is the order of "C" and "A" in "$defs",
# This should not make any difference: both are supposed to be the
# same schema.
schema_fails = {
    "$defs": {
        "C": {
            "properties": {"payload": {"$ref": "#/$defs/A"}},
            "required": ["payload"],
            "title": "C",
            "type": "object",
        },
        "A": {
            "properties": {"payload": {"$ref": "#/$defs/E"}},
            "required": ["payload"],
            "title": "A",
            "type": "object",
        },
        "E": {"type": "boolean"},
    },
    "properties": {"payload": {"$ref": "#/$defs/C"}},
    "required": ["payload"],
    "title": "B",
    "type": "object",
}

schema_works = {
    "$defs": {
        "A": {
            "properties": {"payload": {"$ref": "#/$defs/E"}},
            "required": ["payload"],
            "title": "A",
            "type": "object",
        },
        "C": {
            "properties": {"payload": {"$ref": "#/$defs/A"}},
            "required": ["payload"],
            "title": "C",
            "type": "object",
        },
        "E": {"type": "boolean"},
    },
    "properties": {"payload": {"$ref": "#/$defs/C"}},
    "required": ["payload"],
    "title": "B",
    "type": "object",
}

schema = schema_fails  # or schema_works
# schema_fails generates {"payload": {"payload": {"payload": {"payload": "true"}}}}
# schema_works generates {"payload": {"payload": {"payload": true}}}

response = chat(
    model="mistral-nemo:latest",
    messages=[
        {
            "role": "user",
            "content": "I want to choose true, inside A, inside C, inside B",
        }
    ],
    format=schema,
    options={"temperature": 0},  # Make responses more deterministic
)
valid_json = json.loads(response.message.content)
print(json.dumps(valid_json))
validate(instance=valid_json, schema=schema)
print("validates!")
```

### OS

macOS

### GPU

Apple

### CPU

Apple

### Ollama version

0.5.5
Repository: pytorch
Issue: DISABLED test_aoti_eager_cache_hit_dynamic_shapes_cuda (__main__.DynamicShapesGPUTests)
Labels: module: rocm,triaged,module: flaky-tests,skipped,oncall: pt2,module: inductor

Platforms: rocm

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_aoti_eager_cache_hit_dynamic_shapes_cuda&suite=DynamicShapesGPUTests&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/35679665075).

Over the past 3 hours, it has been determined flaky in 6 workflow(s) with 6 failures and 6 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_aoti_eager_cache_hit_dynamic_shapes_cuda`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/var/lib/jenkins/pytorch/test/inductor/test_torchinductor.py", line 1071, in test_aoti_eager_cache_hit
    res_value = getattr(torch.ops.aten, op_name)(input_tensor)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_ops.py", line 1158, in __call__
    return self._op(*args, **(kwargs or {}))
RuntimeError: aot_compile_function.ptr() != nullptr && aot_compile_function.ptr() != Py_None INTERNAL ASSERT FAILED at "/var/lib/jenkins/workspace/torch/csrc/inductor/aoti_eager/kernel_holder.cpp":507, please report a bug to PyTorch. Failed to import - torch._inductor.aoti_eager.aoti_compile_with_persistent_cache

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_ROCM=1 python test/inductor/test_torchinductor_dynamic_shapes.py DynamicShapesGPUTests.test_aoti_eager_cache_hit_dynamic_shapes_cuda

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `inductor/test_torchinductor_dynamic_shapes.py`

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd @clee2000 @wdvr @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov
Repository: pytorch
Issue: DISABLED test_repeat_graph_capture_cublas_workspace_memory (__main__.TestCuda)
Labels: module: cuda,module: rocm,triaged,module: flaky-tests,skipped

Platforms: rocm

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_repeat_graph_capture_cublas_workspace_memory&suite=TestCuda&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/35670628070).

Over the past 3 hours, it has been determined flaky in 5 workflow(s) with 6 failures and 5 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_repeat_graph_capture_cublas_workspace_memory`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/var/lib/jenkins/pytorch/test/test_cuda.py", line 2048, in test_repeat_graph_capture_cublas_workspace_memory
    self.assertFalse(used_gb_before + 0.1 < used_gb_after)
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 681, in assertFalse
    raise self.failureException(msg)
AssertionError: True is not false

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_ROCM=1 python test/test_cuda.py TestCuda.test_repeat_graph_capture_cublas_workspace_memory

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `test_cuda.py`

cc @ptrblck @msaroufim @eqy @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd @clee2000 @wdvr
Repository: pytorch
Issue: DISABLED test_aoti_eager_support_str_dynamic_shapes_cuda (__main__.DynamicShapesGPUTests)
Labels: module: rocm,triaged,module: flaky-tests,skipped,oncall: pt2,module: inductor

Platforms: rocm

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_aoti_eager_support_str_dynamic_shapes_cuda&suite=DynamicShapesGPUTests&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/35679665765).

Over the past 3 hours, it has been determined flaky in 7 workflow(s) with 7 failures and 7 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_aoti_eager_support_str_dynamic_shapes_cuda`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/var/lib/jenkins/pytorch/test/inductor/test_torchinductor.py", line 1023, in test_aoti_eager_support_str
    res_value = getattr(torch.ops.aten, op_name)(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_ops.py", line 1158, in __call__
    return self._op(*args, **(kwargs or {}))
RuntimeError: create_func_( &container_handle_, num_models, device_str.c_str(), cubin_dir.empty() ? nullptr : cubin_dir.c_str()) API call failed at /var/lib/jenkins/workspace/torch/csrc/inductor/aoti_runner/model_container_runner.cpp, line 81

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_ROCM=1 python test/inductor/test_torchinductor_dynamic_shapes.py DynamicShapesGPUTests.test_aoti_eager_support_str_dynamic_shapes_cuda

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `inductor/test_torchinductor_dynamic_shapes.py`

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd @clee2000 @wdvr @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov
Repository: pytorch
Issue: DISABLED test_aoti_eager_dtype_device_layout_dynamic_shapes_cuda (__main__.DynamicShapesCodegenGPUTests)
Labels: module: rocm,triaged,module: flaky-tests,skipped,oncall: pt2,module: inductor

Platforms: rocm

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_aoti_eager_dtype_device_layout_dynamic_shapes_cuda&suite=DynamicShapesCodegenGPUTests&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/35679666011).

Over the past 3 hours, it has been determined flaky in 9 workflow(s) with 9 failures and 9 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_aoti_eager_dtype_device_layout_dynamic_shapes_cuda`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/var/lib/jenkins/pytorch/test/inductor/test_torchinductor.py", line 925, in test_aoti_eager_dtype_device_layout
    res = torch.tril_indices(
RuntimeError: create_func_( &container_handle_, num_models, device_str.c_str(), cubin_dir.empty() ? nullptr : cubin_dir.c_str()) API call failed at /var/lib/jenkins/workspace/torch/csrc/inductor/aoti_runner/model_container_runner.cpp, line 81

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_ROCM=1 python test/inductor/test_torchinductor_codegen_dynamic_shapes.py DynamicShapesCodegenGPUTests.test_aoti_eager_dtype_device_layout_dynamic_shapes_cuda

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

</details>


Test file path: `inductor/test_torchinductor_codegen_dynamic_shapes.py`

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd @clee2000 @wdvr @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov
Repository: next.js
Issue: Nextjs 15.1 not saving Static Content on Redis on build time using instrumentation using @neshca/cache-handler
Labels: Instrumentation

### Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/priceless-hill-52c3m3

### To Reproduce

1. Update url from cache-handler with your Redis instance
2. yarn install
3. yarn build
4. Verify that no key exists for /index in Redis
5. yarn start
6. Verify that no key exists for /index in Redis, but /xpto in Redis exists
7. Go to the browser and open => http://localhost:3000/
8. Verify that /index key exists in Redis

### Current vs. Expected behavior

I was expecting to have /index and /xpto after yarn build. I don't have anything being saved.
I was expecting to have /index also after yarn start. I only have /xpto being saved.

### Provide environment information

```bash
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Enterprise
  Available memory (MB): 32401
  Available CPU cores: 12
Binaries:
  Node: 22.4.1
  npm: 10.9.0
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.1.4 // Latest available version is detected (15.1.4).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: N/A
Next.js Config:
  output: standalone
```

### Which area(s) are affected? (Select all that apply)

Instrumentation

### Which stage(s) are affected? (Select all that apply)

next build (local), next start (local)

### Additional context

I was expecting to use instrumentation implementation and have Redis cache being populated with pre-rendered pages on build time, but it's only happening on start time. Besides that, I am unable to save the pre-rendered page if my page is on the root of the app, meaning app/page.tsx.
This issue happens both in 15.1 and 14.2.17 next versions.
Repository: flutter
Issue: use Gradle's Kotlin DSL in plugin templates
Labels: c: new feature,platform-android,tool,t: gradle,c: proposal,P2,a: plugins,team-android,triaged-android

### Use case

This request builds on #151166 to ask that templates for _plugins_ also create `build.gradle.kts` for Android.

Using Flutter 3.27.2, `flutter create --template plugin --platforms android` produces Android code with Groovy Gradle files.

See https://github.com/flutter/flutter/tree/3.27.2/packages/flutter_tools/templates/plugin/android-kotlin.tmpl .

### Proposal

See above.
Repository: PowerToys
Issue: make toped windows more obvious
Labels: Needs-Triage

### Description of the new feature / enhancement

please add a sign or pattern on the "always on top" windows (maybe at the left of the minimize？), the frame is too Inconspicuous

I do know the frame can be bolded, but some background or windows is dark, which means I couldn't see if the window is on top.

### Scenario when this would be used?

window on top

### Supporting information

_No response_
Repository: pytorch
Issue: Add API to detect if activation checkpointing is enabled in the current region or not
Labels: module: checkpoint,triaged

### 🚀 The feature, motivation and pitch

I've been developing an experimental feature for torchao and doing a [PoC integration](https://github.com/pytorch/torchtitan/pull/778) in torchtitan. The implementation is based on custom Triton kernels, and we need to execute different kernels at different points in forward/backward depending on if AC is enabled or not.

At a high level:
- If activation checkpointing is enabled, we may want to optimize for peak memory usage and not precompute + save certain tensors for backward. 
- If activation checkpointing is not enabled, we may want to optimize for throughput and precompute some tensors for backward pass during the forward pass, if there is a way to do efficiently. 

After searching for a way to do this online, and then checking with @soulitzer, I found that pytorch currently provides no API to detect if the current region is using activation checkpointing or not. This would be a very useful feature for use cases like the one above.

### Alternatives

As an alternative/workaround, I implemented an explicit flag in my prototype code to indicate if we should optimize for peak memory usage in this particular FP8 linear layer or not, and [execute kernels conditionally based on that flag](https://github.com/pytorch/ao/blob/5e59b510b97d5a1cd08da59b1f6b2df6a1d8cdfd/torchao/prototype/float8nocompile/float8nocompile_linear.py#L72).

However, this is somewhat of a hack and hurts composability with AC. It relies on the user remembering to set this flag if they are using AC in this layer, and requires the user to implement [helper functions](https://github.com/pytorch/torchtitan/pull/778/files#diff-7792012777a5a91b75304ed92ff6414b2f414e1a92a20c7ce9f64b54fb3c7d4bR112-R119) for more advanced AC strategies like selective per layer AC.

### Additional context

_No response_

cc @soulitzer
Repository: vscode
Issue: GitHub - why there is an open github menu? i do not deploy my repo to github
Labels: github

版本: 1.97.0-insider
提交: c799d209cd4846a2a822b55dbf2ca21893008faa
日期: 2025-01-15T23:09:30.246Z
浏览器: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.97.0-insider Chrome/128.0.6613.186 Electron/32.2.7 Safari/537.36

![Image](https://github.com/user-attachments/assets/9a152fc8-66bc-4137-8b0d-c7221bb65ada)
Repository: pytorch
Issue: Error loading "torch\lib\aoti_custom_ops.dll" or one of its dependencies, when importing Torch, when building from Source on Windows 11 with cuDNN.
Labels: module: build,module: windows,triaged

### 🐛 Describe the bug

Hi there, thanks for the great work.

When I build from source on Windows 11, CUDA 12.6, VS 2022, and specifying to use cuDNN (either 9.5.1 or 9.6.0), it gives this next error

```
>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\Users\User\Desktop\pytorch_compile\pytorch\Miniconda3\Lib\site-packages\torch\__init__.py", line 274, in <module>
    _load_dll_libraries()
  File "C:\Users\User\Desktop\pytorch_compile\pytorch\Miniconda3\Lib\site-packages\torch\__init__.py", line 270, in _load_dll_libraries
    raise err
OSError: [WinError 126] No se puede encontrar el módulo especificado. Error loading "C:\Users\Pancho\Desktop\pytorch_compile\pytorch\Miniconda3\Lib\site-packages\torch\lib\aoti_custom_ops.dll" or one of its dependencies.
```

Dependencies doesn't say that a .DLL is missing

![Image](https://github.com/user-attachments/assets/e6f41e03-452b-46ce-b8af-97dda23b0b72)

And procmon shows 

![Image](https://github.com/user-attachments/assets/9ac5ed5b-5eca-4dd7-abf0-9b190e253c6d)

I did have to set on the CMake file:

```
set(CUDNN_LIBRARY_PATH "C:/Program Files/NVIDIA/CUDNN/v9.6/lib/12.6/x64/cudnn64_9.lib")
set(CUDNN_INCLUDE_PATH "C:/Program Files/NVIDIA/CUDNN/v9.6/include/12.6")
```

Else it wouldn't detect it, even if having those env variables set on the Path. Related https://github.com/pytorch/pytorch/issues/114054

Paths are 

[Paths.txt](https://github.com/user-attachments/files/18432859/Paths.txt)

Cmake config is 

[CMakeCache.txt](https://github.com/user-attachments/files/18432788/CMakeCache.txt)

When not setting up cuDNN, torch works abeit very slowly for image diffusion pipelines.

Commit used was 834086c, and used mostly the `.\.ci\pytorch\win-test-helpers\build_pytorch.bat` file.


### Versions

Not applicable (can't import torch)

cc @malfet @seemethere @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex
Repository: ollama
Issue: Multiple goroutines writing to the same file at once likely corrupts downloads
Labels: bug

### What is the issue?

I'm getting a lot of digest errors on windows when downloading new models. Models bigger than 10gb often take multiple tries, for models > 15gb it's nearly impossible to download them.

I think the culprit is likely to be this code:

https://github.com/ollama/ollama/blob/93a8daf285af45ed71544e79aae0cb15245e75f4/server/download.go#L271-L301

I don't think concurrent writes to the same file are safe (at least on windows), even with offsets. 
I think each goroutine should get its own part file which are then merged in the end.

### OS

Windows

### GPU

AMD

### CPU

AMD

### Ollama version

0.5.6
Repository: node
Issue: Add CBOR support
Labels: feature request

### What is the problem this feature will solve?

CBOR is an alternative to JSON.
Due to its binary format and rich data type support, it is ideally suited for machine-to-machine data interchange.

### What is the feature you are proposing to solve the problem?

I'm proposing a "CBOR" counterpart to the "JSON" object.
In similarity to "JSON", a single object should suffice.

https://github.com/cyberphone/CBOR.js#cborjs 

### What alternatives have you considered?

_No response_
Repository: node
Issue: Mixing with `stdin` and `stderr stdout` about readable or writable in Child process spawn API options.stdio doc
Labels: child_process,doc

page link: https://nodejs.org/api/child_process.html#optionsstdio

When descripting the available value of Stream Object, threre are some wrong notes:

1. "While it is technically possible to pass stdin as a writable or stdout/stderr as readable, it is not recommended."
Maybe the actual meaning is "While it is technically possible to pass stdin as a readable or stdout/stderr as writable, it is not recommended."

2. "e.g., passing a readable stream where a writable stream is expected"

This is my screenshot： 
![Image](https://github.com/user-attachments/assets/877c1736-f502-4004-b6b3-11da6de36cd5)
Repository: pytorch
Issue: DISABLED test_run_decompositions_map_handle_to_new_nodes (__main__.TestNumericDebugger)
Labels: oncall: quantization,triaged,module: flaky-tests,module: macos,skipped

Platforms: mac, macos

This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_run_decompositions_map_handle_to_new_nodes&suite=TestNumericDebugger&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/35684218376).

Over the past 3 hours, it has been determined flaky in 8 workflow(s) with 16 failures and 8 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_run_decompositions_map_handle_to_new_nodes`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.


Test file path: `test_quantization.py`

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel @msaroufim @clee2000 @wdvr @malfet @albanD