helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: Fix segfault in moe-expert-reduce test in support mode and coverage

This PR fixes a segmentation fault that occurs while running the `test-backend-ops` tool in `support` mode or with `--show-coverage` flag. This will also allow `docs/ops.md` to be updated for tracking https://github.com/ggml-org/llama.cpp/issues/14909 as it needs the results from `support` mode. 

#### Root Cause
Testing does not initialize `gf` (ggml_cgraph), it calls `build_graph` method for each test case. The `test_moe_expert_reduce` test case calls `ggml_build_forward_expand(gf, ...)` inside its `build_graph` method but `gf` is a `nullptr` in this flow which causes a seg fault.

#### Solution
Wrap the `ggml_build_forward_expand` call in a `gf` null check.

Changed files:
filename: tests/test-backend-ops.cpp
patch: @@ -1454,6 +1454,8 @@ struct test_case {
         ggml_context_ptr ctx(ggml_init(params)); // smart ptr
         GGML_ASSERT(ctx);
 
+        gf = ggml_new_graph_custom(ctx.get(), graph_nodes, false);
+
         ggml_tensor * out = build_graph(ctx.get());
         current_op_name   = op_desc(out);
 
@@ -7569,6 +7571,15 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op
     if (mode == MODE_SUPPORT) {
         auto test_cases = make_test_cases_eval();
         filter_test_cases(test_cases, params_filter);
+
+        // Filter out fusion cases
+        test_cases.erase(
+            std::remove_if(test_cases.begin(), test_cases.end(), [](const std::unique_ptr<test_case> & tc) {
+                return tc->run_whole_graph();
+            }),
+            test_cases.end()
+        );
+
         for (auto & test : test_cases) {
             test->eval_support(backend, op_names_filter, output_printer);
         }
@@ -7619,6 +7630,14 @@ static void show_test_coverage() {
         all_ops.insert(ggml_glu_op_name((enum ggml_glu_op)i));
     }
     auto test_cases = make_test_cases_eval();
+    // Filter out fusion cases
+    test_cases.erase(
+        std::remove_if(test_cases.begin(), test_cases.end(), [](const std::unique_ptr<test_case> & tc) {
+            return tc->run_whole_graph();
+        }),
+        test_cases.end()
+    );
+
     std::set<std::string> tested_ops;
 
     ggml_init_params params = {
Repository: huggingface/transformers
Pull request: Fix the CI workflow of `merge to main`

# What does this PR do?

The workflow lacked a condition and the whole list of models in our codebase were selected to run when there is no change in modeling code.

This PR fixed it.

Changed files:
filename: .github/workflows/push-important-models.yml
patch: @@ -145,6 +145,7 @@ jobs:
     name: Model CI
     uses: ./.github/workflows/self-scheduled.yml
     needs: get_modified_models
+    if: needs.get_modified_models.outputs.matrix != '' && needs.get_modified_models.outputs.matrix != '[]'
     with:
       job: run_models_gpu
       slack_report_channel: "#transformers-ci-push"

filename: .github/workflows/self-scheduled.yml
patch: @@ -515,7 +515,7 @@ jobs:
       run_quantization_torch_gpu,
       run_extract_warnings
     ]
-    if: ${{ always() }}
+    if: always() && !cancelled()
     uses: ./.github/workflows/slack-report.yml
     with:
       job: ${{ inputs.job }}

filename: .github/workflows/slack-report.yml
patch: @@ -93,7 +93,7 @@ jobs:
             python utils/notification_service.py "${{ inputs.quantization_matrix }}"
           else
             python utils/notification_service.py "${{ inputs.folder_slices }}"
-          fi          
+          fi
 
       # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack.
       - name: Failure table artifacts
Repository: nodejs/node
Pull request: lib: fix `getTypeScriptParsingMode` jsdoc

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->

fix type in getTypeScriptParsingMode's jsdoc: `@type {string}` should be `@type {() => TypeScriptMode}`

@marco-ippolito 


Changed files:
filename: lib/internal/modules/typescript.js
patch: @@ -30,7 +30,7 @@ const {
 
 /**
  * The TypeScript parsing mode, either 'strip-only' or 'transform'.
- * @type {string}
+ * @type {function(): TypeScriptMode}
  */
 const getTypeScriptParsingMode = getLazy(() =>
   (getOptionValue('--experimental-transform-types') ?
Repository: ollama/ollama
Pull request: offload 75% of available vram to improve stability

Reducing the amount of layers off-loaded to vram to prevent out of memory errors on larger models. In my tests 7B and 13B models with 4-bit quantization still maxed out the number of layers and ran fast. Meanwhile, 70B models can now run on a T4 when they would previously crash with out-of-memory errors, but its still slow in this case.

Our heuristic of memory required per layer being roughly the file size divided by the number of layers seems somewhat reliable after additional testing. The calculation for the amount of memory needed for weights looks something like this:
```
size of weights = number of parameters * number of bytes per parameter
```
This roughly equates to file size.

I also added some clarity in the comment around storing the kv cache in vram.

resolves #790 

Changed files:
filename: llm/llama.go
patch: @@ -243,12 +243,15 @@ func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
 			return 0
 		}
 
-		// Calculate bytes per layer
-		// TODO: this is a rough heuristic, better would be to calculate this based on number of layers and context size
+		/*
+		 Calculate bytes per layer, this will roughly be the size of the model file divided by the number of layers.
+		 We can store the model weights and the kv cache in vram,
+		 to enable kv chache vram storage add two additional layers to the number of layers retrieved from the model file.
+		*/
 		bytesPerLayer := fileSizeBytes / numLayer
 
-		// max number of layers we can fit in VRAM, subtract 8% to prevent consuming all available VRAM and running out of memory
-		layers := int(freeBytes/bytesPerLayer) * 92 / 100
+		// 75% of the absolute max number of layers we can fit in available VRAM, off-loading too many layers to the GPU can cause OOM errors
+		layers := int(freeBytes/bytesPerLayer) * 3 / 4
 		log.Printf("%d MB VRAM available, loading up to %d GPU layers", freeBytes/(1024*1024), layers)
 
 		return layers
Repository: ollama/ollama
Pull request: add bracketed paste mode

This change allows you to cut/paste into the REPL without have to add the """ around a block of text.

I've tested it out with:
  * Terminal.app
  * iTerm2
  * Warp



Changed files:
filename: cmd/cmd.go
patch: @@ -553,6 +553,9 @@ func generateInteractive(cmd *cobra.Command, model string) error {
 		wordWrap = false
 	}
 
+	fmt.Print(readline.StartBracketedPaste)
+	defer fmt.Printf(readline.EndBracketedPaste)
+
 	var multiLineBuffer string
 
 	for {

filename: readline/readline.go
patch: @@ -65,8 +65,7 @@ func (i *Instance) Readline() (string, error) {
 	var esc bool
 	var escex bool
 	var metaDel bool
-	var bracketedPaste bool
-	var ignoreEnter bool
+	var pasteMode PasteMode
 
 	var currentLineBuf []rune
 
@@ -111,7 +110,16 @@ func (i *Instance) Readline() (string, error) {
 			case KeyRight:
 				buf.MoveRight()
 			case CharBracketedPaste:
-				bracketedPaste = true
+				var code string
+				for cnt := 0; cnt < 3; cnt++ {
+					r = i.Terminal.ReadRune()
+					code += string(r)
+				}
+				if code == CharBracketedPasteStart {
+					pasteMode = PasteModeStart
+				} else if code == CharBracketedPasteEnd {
+					pasteMode = PasteModeEnd
+				}
 			case KeyDel:
 				if buf.Size() > 0 {
 					buf.Delete()
@@ -141,10 +149,6 @@ func (i *Instance) Readline() (string, error) {
 		}
 
 		switch r {
-		case CharBracketedPasteStart:
-			if bracketedPaste {
-				ignoreEnter = true
-			}
 		case CharEsc:
 			esc = true
 		case CharInterrupt:
@@ -179,16 +183,19 @@ func (i *Instance) Readline() (string, error) {
 		case CharCtrlW:
 			buf.DeleteWord()
 		case CharEnter:
-			if !ignoreEnter {
-				output := buf.String()
-				if output != "" {
-					i.History.Add([]rune(output))
-				}
-				buf.MoveToEnd()
-				fmt.Println()
-				return output, nil
+			output := buf.String()
+			if output != "" {
+				i.History.Add([]rune(output))
+			}
+			buf.MoveToEnd()
+			fmt.Println()
+			switch pasteMode {
+			case PasteModeStart:
+				output = `"""` + output
+			case PasteModeEnd:
+				output = output + `"""`
 			}
-			fallthrough
+			return output, nil
 		default:
 			if metaDel {
 				metaDel = false

filename: readline/types.go
patch: @@ -72,6 +72,14 @@ const (
 
 const (
 	CharBracketedPaste      = 50
-	CharBracketedPasteStart = 0
-	CharBracketedPasteEnd   = 1
+	CharBracketedPasteStart = "00~"
+	CharBracketedPasteEnd   = "01~"
+)
+
+type PasteMode int
+
+const (
+	PastModeOff = iota
+	PasteModeStart
+	PasteModeEnd
 )
Repository: denoland/deno
Pull request: test: use `Deno.execPath()` instead of `deno`

Currently most TS tests use `Deno.execPath()` to identify where `deno` lives
In the event deno is not on the `$PATH` these tests will fail.
If deno is on the `$PATH` you can end up testing the wrong instance of `deno`.

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->


Changed files:
filename: tests/unit/process_test.ts
patch: @@ -623,7 +623,7 @@ Deno.test(
 
     // @ts-ignore `Deno.run()` was soft-removed in Deno 2.
     const p = Deno.run({
-      cmd: ["deno", "run", "--watch", tempFile],
+      cmd: [Deno.execPath(), "run", "--watch", tempFile],
       stdout: "piped",
       stderr: "null",
     });
@@ -661,7 +661,7 @@ Deno.serve({ signal: ac.signal }, () => new Response("Hello World"));
 
     // @ts-ignore `Deno.run()` was soft-removed in Deno 2.
     const p = Deno.run({
-      cmd: ["deno", "run", "--watch", tempFile],
+      cmd: [Deno.execPath(), "run", "--watch", tempFile],
       stdout: "piped",
       stderr: "null",
     });
Repository: vercel/next.js
Pull request: Turbopack: fix race condition in unit test

### What?

Fix a race condition in the unit test (similar to the same race condition fixed in the read_ref_cell test case)

Closes PACK-5330

Changed files:
filename: turbopack/crates/turbo-tasks-backend/tests/trait_ref_cell.rs
patch: @@ -2,7 +2,7 @@
 #![feature(arbitrary_self_types_pointers)]
 #![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this
 
-use std::sync::Mutex;
+use std::{collections::HashSet, mem::take, sync::Mutex};
 
 use anyhow::Result;
 use turbo_tasks::{IntoTraitRef, Invalidator, TraitRef, Vc, get_invalidator};
@@ -14,7 +14,7 @@ static REGISTRATION: Registration = register!();
 async fn trait_ref() {
     run(&REGISTRATION, || async {
         let counter = Counter::cell(Counter {
-            value: Mutex::new((0, None)),
+            value: Mutex::new((0, Default::default())),
         });
 
         let counter_value = counter.get_value();
@@ -64,14 +64,14 @@ struct CounterValue(usize);
 #[turbo_tasks::value(serialization = "none", cell = "new", eq = "manual")]
 struct Counter {
     #[turbo_tasks(debug_ignore, trace_ignore)]
-    value: Mutex<(usize, Option<Invalidator>)>,
+    value: Mutex<(usize, HashSet<Invalidator>)>,
 }
 
 impl Counter {
     fn incr(&self) {
         let mut lock = self.value.lock().unwrap();
         lock.0 += 1;
-        if let Some(i) = lock.1.take() {
+        for i in take(&mut lock.1) {
             i.invalidate();
         }
     }
@@ -90,7 +90,7 @@ impl CounterTrait for Counter {
     #[turbo_tasks::function]
     fn get_value(&self) -> Result<Vc<CounterValue>> {
         let mut lock = self.value.lock().unwrap();
-        lock.1 = Some(get_invalidator());
+        lock.1.insert(get_invalidator());
         Ok(Vc::cell(lock.0))
     }
Repository: electron/electron
Pull request: fix: crash on parent window close and focur/blur

#### Description of Change

Closes https://github.com/electron/electron/issues/45595.

Adds missing checks for `api_web_contents_` validity present in other methods in this file but missing here.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)(https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed a possible BrowserWindow crash caused by closing a parent window with focus or blur events.

Changed files:
filename: shell/browser/api/electron_api_browser_window.cc
patch: @@ -219,14 +219,14 @@ void BrowserWindow::CloseImmediately() {
 }
 
 void BrowserWindow::Focus() {
-  if (api_web_contents_->IsOffScreen())
+  if (api_web_contents_ && api_web_contents_->IsOffScreen())
     FocusOnWebView();
   else
     BaseWindow::Focus();
 }
 
 void BrowserWindow::Blur() {
-  if (api_web_contents_->IsOffScreen())
+  if (api_web_contents_ && api_web_contents_->IsOffScreen())
     BlurWebView();
   else
     BaseWindow::Blur();

filename: spec/api-browser-window-spec.ts
patch: @@ -4930,6 +4930,18 @@ describe('BrowserWindow module', () => {
         expect(w.getChildWindows().length).to.equal(0);
       });
 
+      it('can handle parent window close with focus or blur events', (done) => {
+        const w = new BrowserWindow({ show: false });
+        const c = new BrowserWindow({ show: false, parent: w });
+
+        c.on('closed', () => {
+          w.focus();
+          done();
+        });
+
+        w.close();
+      });
+
       ifit(process.platform === 'darwin')('only shows the intended window when a child with siblings is shown', async () => {
         const w = new BrowserWindow({ show: false });
         const childOne = new BrowserWindow({ show: false, parent: w });
Repository: huggingface/transformers
Pull request: Collated reports: no need to upload artifact

Since we already upload to a specified dataset there is no need to upload it to the gh artifact registry as well.

Changed files:
filename: .github/workflows/collated-reports.yml
patch: @@ -41,9 +41,3 @@ jobs:
             --job ${{ inputs.job }}                          \
             --report-repo-id ${{ inputs.report_repo_id }}    \
             --gpu-name ${{ inputs.gpu_name }}
-
-      - name: Upload collated reports
-        uses: actions/upload-artifact@v4
-        with:
-          name: collated_reports_${{ env.CI_SHA }}.json
-          path: collated_reports_${{ env.CI_SHA }}.json
Repository: facebook/react
Pull request: Use separate feature flag for ReactTestRenderer

The ReactDOMFeatureFlags is not reachable from the npm package since it is in a separate build so we need a separate one.


Changed files:
filename: scripts/jest/test-framework-setup.js
patch: @@ -22,6 +22,12 @@ jest.mock('ReactNativeFeatureFlags', () => {
     useFiber: flags.useFiber || !!process.env.REACT_DOM_JEST_USE_FIBER,
   });
 });
+jest.mock('ReactTestRendererFeatureFlags', () => {
+  const flags = require.requireActual('ReactTestRendererFeatureFlags');
+  return Object.assign({}, flags, {
+    useFiber: flags.useFiber || !!process.env.REACT_DOM_JEST_USE_FIBER,
+  });
+});
 
 // Error logging varies between Fiber and Stack;
 // Rather than fork dozens of tests, mock the error-logging file by default.

filename: src/renderers/testing/ReactTestRenderer.js
patch: @@ -11,8 +11,8 @@
 
 'use strict';
 
-const ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
+const ReactTestRendererFeatureFlags = require('ReactTestRendererFeatureFlags');
 
-module.exports = ReactDOMFeatureFlags.useFiber
+module.exports = ReactTestRendererFeatureFlags.useFiber
   ? require('ReactTestRendererFiber')
   : require('ReactTestRendererStack');

filename: src/renderers/testing/ReactTestRendererFeatureFlags.js
patch: @@ -0,0 +1,18 @@
+/**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule ReactTestRendererFeatureFlags
+ */
+
+'use strict';
+
+var ReactTestRendererFeatureFlags = {
+  useFiber: false,
+};
+
+module.exports = ReactTestRendererFeatureFlags;
Repository: ollama/ollama
Pull request: fix(download): no retry when out of space

Resolves #911 

Changed files:
filename: server/download.go
patch: @@ -15,6 +15,7 @@ import (
 	"strings"
 	"sync"
 	"sync/atomic"
+	"syscall"
 	"time"
 
 	"golang.org/x/sync/errgroup"
@@ -158,7 +159,8 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
 				w := io.NewOffsetWriter(file, part.StartsAt())
 				err := b.downloadChunk(inner, requestURL, w, part, opts)
 				switch {
-				case errors.Is(err, context.Canceled):
+				case errors.Is(err, context.Canceled), errors.Is(err, syscall.ENOSPC):
+					// return immediately if the context is canceled or the device is out of space
 					return err
 				case err != nil:
 					log.Printf("%s part %d attempt %d failed: %v, retrying", b.Digest[7:19], i, try, err)
Repository: electron/electron
Pull request: fix: remove obsoleted `--inspect-brk` logic

Backport of #46560

See that PR for details.


Notes: Fixed an issue with `--inspect-brk`  failing in packaged apps.

Changed files:
filename: lib/browser/init.ts
patch: @@ -218,7 +218,6 @@ if (packagePath) {
   } else {
     // Call appCodeLoaded before just for safety, it doesn't matter here as _load is synchronous
     appCodeLoaded!();
-    process._firstFileName = Module._resolveFilename(path.join(packagePath, mainStartupScript), null, false);
     Module._load(path.join(packagePath, mainStartupScript), Module, true);
   }
 } else {

filename: patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
patch: @@ -7,24 +7,6 @@ This allows embedders to tell Node.js what the first "real" file is  when
 they use themselves as the entry point. We should try to upstream some form
 of this.
 
-diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index 9b5772fe9b8babbb892c7a5ec79258472da55a76..3568fd6ea0816f62d97d46f5d497bb1b23bf4e25 100644
---- a/lib/internal/modules/cjs/loader.js
-+++ b/lib/internal/modules/cjs/loader.js
-@@ -1555,6 +1555,13 @@ Module.prototype._compile = function(content, filename, format) {
-   this[kIsExecuting] = true;
-   if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) {
-     const { callAndPauseOnStart } = internalBinding('inspector');
-+    // process._firstFileName is used by Embedders to tell node what
-+    // the first "real" file is when they use themselves as the entry
-+    // point
-+    if (process._firstFileName) {
-+      resolvedArgv = process._firstFileName;
-+      delete process._firstFileName;
-+    }
-     result = callAndPauseOnStart(compiledWrapper, thisValue, exports,
-                                  require, module, filename, dirname,
-                                  process, localGlobal, localBuffer);
 diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
 index d1c05d1717cdc825c4e48885c963c9ed65bcf51c..278665921c5160ff10b3178db27d4df319fab6b3 100644
 --- a/lib/internal/process/pre_execution.js

filename: typings/internal-ambient.d.ts
patch: @@ -255,7 +255,6 @@ declare namespace NodeJS {
     once(event: 'document-end', listener: () => any): this;
 
     // Additional properties
-    _firstFileName?: string;
     _serviceStartupScript: string;
     _getOrCreateArchive?: (path: string) => NodeJS.AsarArchive | null;
Repository: denoland/deno
Pull request: fix: ArrayIsArray undefined variable Error 

Closes #30892.

Changed files:
filename: ext/node/polyfills/_tls_wrap.js
patch: @@ -5,6 +5,7 @@
 // deno-lint-ignore-file prefer-primordials
 
 import {
+  ArrayIsArray,
   ObjectAssign,
   StringPrototypeReplace,
 } from "ext:deno_node/internal/primordials.mjs";