helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: main_gpu argument is not getting set for llamacpp

In a multi-GPU platform I observed I cannot set the main GPU to be used to llamacpp though llamacpp itself support this through `main_gpu` argument.


This PR fixes just that.

Changed files:
filename: llm/llama.go
patch: @@ -339,6 +339,7 @@ func newLlama(model string, adapters []string, runners []ModelRunner, numLayers
 		"--model", model,
 		"--ctx-size", fmt.Sprintf("%d", opts.NumCtx),
 		"--batch-size", fmt.Sprintf("%d", opts.NumBatch),
+		"--main-gpu", fmt.Sprintf("%d", opts.MainGPU),
 		"--n-gpu-layers", fmt.Sprintf("%d", numGPU),
 		"--embedding",
 	}
@@ -544,6 +545,7 @@ func (llm *llama) Predict(ctx context.Context, prevContext []int, prompt string,
 		"stream":            true,
 		"n_predict":         llm.NumPredict,
 		"n_keep":            llm.NumKeep,
+		"main_gpu":          llm.MainGPU,
 		"temperature":       llm.Temperature,
 		"top_k":             llm.TopK,
 		"top_p":             llm.TopP,
Repository: ollama/ollama
Pull request: Remove redundant filename parameter in api request for `ollama create`


Changed files:
filename: cmd/cmd.go
patch: @@ -132,7 +132,7 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 		return nil
 	}
 
-	request := api.CreateRequest{Name: args[0], Path: filename, Modelfile: string(modelfile)}
+	request := api.CreateRequest{Name: args[0], Modelfile: string(modelfile)}
 	if err := client.Create(context.Background(), &request, fn); err != nil {
 		return err
 	}
Repository: denoland/deno
Pull request: ci: move lsp-tracing feature check to 'build-libs' job

This stage was needlessly slowing down the debug Linux build.

Changed files:
filename: .github/workflows/ci.generate.ts
patch: @@ -702,13 +702,6 @@ const ci = {
           run:
             "deno run --allow-read --allow-env --allow-sys ./tools/jsdoc_checker.js",
         },
-        {
-          name: "Check tracing build",
-          if:
-            "matrix.job == 'test' && matrix.profile == 'debug' && matrix.os == 'linux' && matrix.arch == 'x86_64'",
-          run: "cargo check -p deno --features=lsp-tracing",
-          env: { CARGO_PROFILE_DEV_DEBUG: 0 },
-        },
         {
           name: "Build debug",
           if: "matrix.job == 'test' && matrix.profile == 'debug'",
@@ -1247,6 +1240,7 @@ const ci = {
             "cargo check --no-default-features --features package_json -p deno_config",
             "cargo check --no-default-features --features workspace --features sync -p deno_config",
             "cargo check --target wasm32-unknown-unknown --all-features -p deno_config",
+            "cargo check -p deno --features=lsp-tracing",
           ].join("\n"),
         },
       ]),

filename: .github/workflows/ci.yml
patch: @@ -414,11 +414,6 @@ jobs:
       - name: jsdoc_checker.js
         if: '!(matrix.skip) && (matrix.job == ''lint'')'
         run: deno run --allow-read --allow-env --allow-sys ./tools/jsdoc_checker.js
-      - name: Check tracing build
-        if: '!(matrix.skip) && (matrix.job == ''test'' && matrix.profile == ''debug'' && matrix.os == ''linux'' && matrix.arch == ''x86_64'')'
-        run: cargo check -p deno --features=lsp-tracing
-        env:
-          CARGO_PROFILE_DEV_DEBUG: 0
       - name: Build debug
         if: '!(matrix.skip) && (matrix.job == ''test'' && matrix.profile == ''debug'')'
         run: cargo build --locked --all-targets --features=panic-trace
@@ -810,6 +805,7 @@ jobs:
           cargo check --no-default-features --features package_json -p deno_config
           cargo check --no-default-features --features workspace --features sync -p deno_config
           cargo check --target wasm32-unknown-unknown --all-features -p deno_config
+          cargo check -p deno --features=lsp-tracing
         if: '!(matrix.skip)'
   publish-canary:
     name: publish canary
Repository: facebook/react
Pull request: Devtools: Fix build-for-devtools

Stack:
1. https://github.com/facebook/react/pull/28975
1. https://github.com/facebook/react/pull/28976 <--- You're here
1. https://github.com/facebook/react/pull/28974

## Summary

Some devtools code imports from `shared/` this could result in `shared/FeatureFlags` becoming part of the module graph as it did with https://github.com/facebook/react/issues/28813. Without this fix, we'd have a bare `__EXPERIMENTAL__` identifier that would result in `react_devtools_backend_compact.js:3724 Uncaught ReferenceError: __EXPERIMENTAL__ is not defined` in the final build. 

We already hardcoded `__EXPERIMENTAL__: true` in the frontend Webpack config so I'm doing the same for the backend.

## How did you test this change?

- [x] Use `react-devtools-chrome-extension.zip` from this branch and no longer observe `ReferenceError` when inspecting a React app


Changed files:
filename: package.json
patch: @@ -108,7 +108,7 @@
   },
   "scripts": {
     "build": "node ./scripts/rollup/build-all-release-channels.js",
-    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE",
+    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/client,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE",
     "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
     "build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
     "linc": "node ./scripts/tasks/linc.js",

filename: packages/react-devtools-extensions/webpack.backend.js
patch: @@ -75,6 +75,8 @@ module.exports = {
       __DEV__: true,
       __PROFILE__: false,
       __DEV____DEV__: true,
+      // By importing `shared/` we may import ReactFeatureFlags
+      __EXPERIMENTAL__: true,
       'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
       'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
       'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
Repository: electron/electron
Pull request: fix: do not run microtasks in V8Serializer in browser process

Backport of #46668

See that PR for details.


Notes: Microtasks are no longer (incorrectly) run by serializing values, including when sending IPC.


Changed files:
filename: shell/common/v8_util.cc
patch: @@ -36,7 +36,7 @@ class V8Serializer : public v8::ValueSerializer::Delegate {
 
   bool Serialize(v8::Local<v8::Value> value, blink::CloneableMessage* out) {
     gin_helper::MicrotasksScope microtasks_scope{
-        isolate_->GetCurrentContext(), false,
+        isolate_->GetCurrentContext(), true,
         v8::MicrotasksScope::kDoNotRunMicrotasks};
     WriteBlinkEnvelope(19);
Repository: ggml-org/llama.cpp
Pull request: Vulkan: Fix the memory allocation change in #17110

I forgot to exit the second loop early in #17110. This should fix #17117.

Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -2220,9 +2220,12 @@ static vk_buffer ggml_vk_create_buffer(vk_device& device, size_t size, const std
         }
         buf->memory_property_flags = req_flags;
 
+        bool done = false;
+
         for (auto mtype_it = memory_type_indices.begin(); mtype_it != memory_type_indices.end(); mtype_it++) {
             try {
                 buf->device_memory = device->device.allocateMemory({ mem_req.size, *mtype_it, &mem_flags_info });
+                done = true;
                 break;
             } catch (const vk::SystemError& e) {
                 // loop and retry
@@ -2233,6 +2236,10 @@ static vk_buffer ggml_vk_create_buffer(vk_device& device, size_t size, const std
                 }
             }
         }
+
+        if (done) {
+            break;
+        }
     }
 
     if (!buf->device_memory) {
Repository: ollama/ollama
Pull request: enable metal for fp32, q5_0, q5_1

recent llama.cpp update added kernels for fp32, q5_0, and q5_1

resolves #1200 

Changed files:
filename: llm/llm.go
patch: @@ -41,20 +41,13 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
 
 	if runtime.GOOS == "darwin" {
 		switch ggml.FileType() {
-		case "Q8_0":
+		case "F32", "Q5_0", "Q5_1", "Q8_0":
 			if ggml.Name() != "gguf" && opts.NumGPU != 0 {
 				// GGML Q8_0 do not support Metal API and will
 				// cause the runner to segmentation fault so disable GPU
 				log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
 				opts.NumGPU = 0
 			}
-		case "F32", "Q5_0", "Q5_1":
-			if opts.NumGPU != 0 {
-				// F32, Q5_0, Q5_1, and Q8_0 do not support Metal API and will
-				// cause the runner to segmentation fault so disable GPU
-				log.Printf("WARNING: GPU disabled for F32, Q5_0, Q5_1, and Q8_0")
-				opts.NumGPU = 0
-			}
 		}
 
 		var requiredMemory int64
Repository: denoland/deno
Pull request: ci: remove wpt_epoch job

This workflow is not useful anymore. It crashes constantly and requires manual
intervention with every change. Gonna switch to manual updates.

Changed files:
filename: .github/workflows/wpt_epoch.yml
patch: @@ -1,80 +0,0 @@
-# This CI job runs every night and tests all versions of Deno (canary and latest
-# stable) across all OSes we support against the `epochs/daily` branch of WPT.
-
-name: wpt_epoch
-
-on:
-  schedule:
-    # Every night at 0:30 UTC. This is 20 minutes after `epochs/daily` branch is
-    # triggered to be created in WPT repo.
-    - cron: 30 0 * * *
-  workflow_dispatch:
-
-jobs:
-  wpt:
-    name: wpt / ${{ matrix.os }} / ${{ matrix.deno-version }}
-    if: github.repository == 'denoland/deno'
-    runs-on: ${{ matrix.os }}
-    timeout-minutes: 30
-    strategy:
-      fail-fast: false
-      matrix:
-        deno-version: [v1.x, canary]
-        os: [ubuntu-24.04-xl]
-
-    steps:
-      - name: Clone repository
-        uses: actions/checkout@v4
-        with:
-          submodules: true
-          persist-credentials: false
-
-      - name: Setup Deno
-        uses: denoland/setup-deno@v2
-        with:
-          deno-version: ${{ matrix.deno-version }}
-
-      - name: Install Python
-        uses: actions/setup-python@v5
-        with:
-          python-version: '3.11'
-
-      - name: Log versions
-        run: |
-          python --version
-          deno --version
-
-      - name: Switch WPT submodule to epochs/daily
-        working-directory: tests/wpt/suite/
-        shell: bash
-        run: |
-          git remote set-branches origin '*'
-          git fetch origin
-          git checkout $(./wpt rev-list --epoch 1d)
-          git checkout -b epochs/daily
-
-      - name: Configure hosts file for WPT (unix)
-        if: runner.os != 'Windows'
-        working-directory: tests/wpt/suite/
-        run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
-
-      - name: Configure hosts file for WPT (windows)
-        if: runner.os == 'Windows'
-        working-directory: tests/wpt/suite/
-        run: python wpt make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append
-
-      - name: Run web platform tests
-        shell: bash
-        run: |
-          deno run -A --lock=tools/deno.lock.json --config=tests/config/deno.json \
-            ./tests/wpt/wpt.ts setup
-          deno run -A --lock=tools/deno.lock.json --config=tests/config/deno.json \
-            ./tests/wpt/wpt.ts run                                             \                                                \
-            --binary=$(which deno) --quiet --release --no-ignore --json=wpt.json --wptreport=wptreport.json --exit-zero
-
-      - name: Upload wpt results to wpt.fyi
-        env:
-          WPT_FYI_USER: deno
-          WPT_FYI_PW: ${{ secrets.WPT_FYI_PW }}
-        run: |
-          deno run -A --lock=tools/deno.lock.json ./tools/upload_wptfyi.js wptreport.json --from-raw-file --daily-run
Repository: vercel/next.js
Pull request: Turbopack: fix persistent caching test case

### What?

The test case was broken and never tested if persistent caching was caching at all

Closes PACK-5374

Changed files:
filename: test/e2e/persistent-caching/my-loader.js
patch: @@ -1,4 +1,5 @@
 module.exports = async function myLoader(source) {
+  console.log('Loader is running!')
   // Make webpack consider the build as large change which makes it persistent cache it sooner
   await new Promise((resolve) => setTimeout(resolve, 2000))
   return source.replace(/Timestamp/g, `Timestamp = ${Date.now()}`)

filename: test/e2e/persistent-caching/next.config.js
patch: @@ -4,10 +4,13 @@
 const nextConfig = {
   turbopack: {
     rules: {
-      'app/page.tsx': {
+      './app/page.tsx': {
         loaders: ['./my-loader.js'],
       },
-      'pages/pages.tsx': {
+      './app/client/page.tsx': {
+        loaders: ['./my-loader.js'],
+      },
+      './pages/pages.tsx': {
         loaders: ['./my-loader.js'],
       },
     },
@@ -17,7 +20,7 @@ const nextConfig = {
   },
   webpack(config) {
     config.module.rules.push({
-      test: /app\/page\.tsx|pages\/pages.tsx/,
+      test: /app\/page\.tsx|app\/client\/page\.tsx|pages\/pages\.tsx/,
       use: ['./my-loader.js'],
     })
 

filename: test/e2e/persistent-caching/persistent-caching.test.ts
patch: @@ -39,16 +39,19 @@ describe('persistent-caching', () => {
     {
       const browser = await next.browser('/')
       appTimestamp = await browser.elementByCss('main').text()
+      expect(appTimestamp).toMatch(/Timestamp = \d+/)
       await browser.close()
     }
     {
       const browser = await next.browser('/client')
       appClientTimestamp = await browser.elementByCss('main').text()
+      expect(appClientTimestamp).toMatch(/Timestamp = \d+/)
       await browser.close()
     }
     {
       const browser = await next.browser('/pages')
       pagesTimestamp = await browser.elementByCss('main').text()
+      expect(pagesTimestamp).toMatch(/Timestamp = \d+/)
       await browser.close()
     }
     await restartCycle()
Repository: ollama/ollama
Pull request: fix: allow specifying relative files in modelfile

Small regression here from remote models. Previously you could specify files relative to a modelfile without their path, this is my normal workflow. This change restores this behaviour to match v0.1.9.

Example modelfile:
```
FROM nous-capybara-34b.Q4_0.gguf
TEMPLATE "USER: { .Prompt } ASSISTANT: "
```

Changed files:
filename: cmd/cmd.go
patch: @@ -82,6 +82,10 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 				path = filepath.Join(home, path[2:])
 			}
 
+			if !filepath.IsAbs(path) {
+				path = filepath.Join(filepath.Dir(filename), path)
+			}
+
 			bin, err := os.Open(path)
 			if errors.Is(err, os.ErrNotExist) && c.Name == "model" {
 				continue
Repository: facebook/react
Pull request: [Tooling] Update critical artifact list

When a React PR is opened CI will report large size changes. But for critical packages like react-dom it reports always. In React 19 we moved the build for react-dom the client reconciler from react-dom to react-dom/client

This change adds react-dom-client artifacts for stable and oss channels since that is originally what was being tracked. But since react-dom/client always imports react-dom I left the original react-dom packages as critical as well. They are small but it would be good to keep an eye on them


Changed files:
filename: dangerfile.js
patch: @@ -44,7 +44,9 @@ const CRITICAL_ARTIFACT_PATHS = new Set([
   // We always report changes to these bundles, even if the change is
   // insignificant or non-existent.
   'oss-stable/react-dom/cjs/react-dom.production.js',
+  'oss-stable/react-dom/cjs/react-dom-client.production.js',
   'oss-experimental/react-dom/cjs/react-dom.production.js',
+  'oss-experimental/react-dom/cjs/react-dom-client.production.js',
   'facebook-www/ReactDOM-prod.classic.js',
   'facebook-www/ReactDOM-prod.modern.js',
 ]);
Repository: electron/electron
Pull request: fix: do not run microtasks in V8Serializer in browser process

#### Description of Change

Fixes #46654

> The root cause is that webContents.send eventually calls [Serialize](https://github.com/electron/electron/blob/32fea719b393c2757c4737386564c910d49b529e/shell/common/v8_util.cc#L37-L40), which has a `gin_helper::MicrotasksScope` that was changed in https://github.com/electron/electron/pull/43209. That change was one of the few that were unclear what the desired behavior should be and changed.

#### Release Notes

Notes: Microtasks are no longer (incorrectly) run by serializing values, including when sending IPC.


Changed files:
filename: shell/common/v8_util.cc
patch: @@ -36,7 +36,7 @@ class V8Serializer : public v8::ValueSerializer::Delegate {
 
   bool Serialize(v8::Local<v8::Value> value, blink::CloneableMessage* out) {
     gin_helper::MicrotasksScope microtasks_scope{
-        isolate_->GetCurrentContext(), false,
+        isolate_->GetCurrentContext(), true,
         v8::MicrotasksScope::kDoNotRunMicrotasks};
     WriteBlinkEnvelope(19);
Repository: nodejs/node
Pull request: meta: add IlyasShabi to collaborators

Fixes: https://github.com/nodejs/node/issues/58766

<!--
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.
-->


Changed files:
filename: README.md
patch: @@ -355,6 +355,8 @@ For information about the governance of the Node.js project, see
   **Harshitha K P** <<harshitha014@gmail.com>> (she/her)
 * [himself65](https://github.com/himself65) -
   **Zeyu "Alex" Yang** <<himself65@outlook.com>> (he/him)
+* [IlyasShabi](https://github.com/IlyasShabi) -
+  **Ilyas Shabi** <<ilyasshabi94@gmail.com>> (he/him)
 * [islandryu](https://github.com/islandryu) -
   **Ryuhei Shima** <<shimaryuhei@gmail.com>> (he/him)
 * [jakecastelli](https://github.com/jakecastelli) -
Repository: ggml-org/llama.cpp
Pull request: mtmd : fix embedding size for image input

fix  #17115
cont #16928 

Use the correct embedding size in `mtmd_helper_decode_image_chunk()`

Changed files:
filename: tools/mtmd/mtmd-helper.cpp
patch: @@ -182,7 +182,7 @@ int32_t mtmd_helper_decode_image_chunk(
     }
 
     const llama_model * model = llama_get_model(lctx);
-    int n_mmproj_embd = llama_model_n_embd(model);
+    int n_mmproj_embd = llama_model_n_embd_inp(model);
     int n_pos_per_embd = mtmd_decode_use_mrope(ctx) ? 4 : 1;
 
     int32_t n_tokens = mtmd_input_chunk_get_n_tokens(chunk);
Repository: ggml-org/llama.cpp
Pull request: server : handle failures to restore host cache

fix #17060 #17118
cont #16391 

With unified caches, restoring an old prompt from the host-memory cache is not guaranteed to be successful because there might not be enough free room in the context memory to fit it. Handle this gracefully by reprocessing the prompt from scratch.

Changed files:
filename: tools/server/server.cpp
patch: @@ -1690,6 +1690,9 @@ struct server_slot {
         bool res = prompt_cache.load(prompt, tokens, ctx, id);
         if (!res) {
             SLT_WRN(*this, "%s", "failed to load prompt from cache\n");
+
+            llama_memory_seq_rm(llama_get_memory(ctx), id, -1, -1);
+            prompt.tokens.clear();
         }
     }
 

filename: tools/server/tests/unit/test_completion.py
patch: @@ -1,6 +1,8 @@
 import pytest
 import requests
 import time
+import random
+
 from openai import OpenAI
 from utils import *
 
@@ -564,3 +566,43 @@ def test_cancel_request():
     time.sleep(1) # wait for HTTP_POLLING_SECONDS
     res = server.make_request("GET", "/slots")
     assert res.body[0]["is_processing"] == False
+
+
+# this test exercises the host-memory prompt cache
+# ref: https://github.com/ggml-org/llama.cpp/pull/16391
+# ref: https://github.com/ggml-org/llama.cpp/pull/17078
+def test_completion_prompt_cache():
+    global server
+    server.n_slots = 2
+    server.kv_unified = True
+    server.start()
+
+    for _ in range(16):
+        # generate alternating random prompts with variable lengths in order to get them in and out of the cache
+        r = random.randint(0, 4)
+        prompt = (" Hello " +  str(r)) * (40 + r)
+        n_prompt = (40 + r)*5 + 2
+        n_predict = random.randint(1, 8)
+
+        res = server.make_request(
+            "POST",
+            "/completion",
+            data={
+                "prompt": prompt,
+                "n_predict": n_predict,
+            },
+        )
+
+        assert res.status_code == 200
+        assert "content" in res.body
+        content = res.body["content"]
+        assert isinstance(content, str)
+        assert len(content) > 0
+
+        assert type(res.body["has_new_line"]) == bool
+        assert "timings" in res.body
+        timings = res.body["timings"]
+
+        assert "prompt_n" in timings and timings["prompt_n"] + timings["cache_n"] == n_prompt
+        assert "predicted_n" in timings and timings["predicted_n"] == n_predict
+        assert "tokens" in res.body and isinstance(res.body["tokens"], list)