helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: Wire up windows AMD driver reporting

This seems to be ROCm version, not actually driver version, but it may be useful for toggling logic for VRAM reporting in the future


Before:
```
time=2024-06-18T15:56:19.574-07:00 level=INFO source=types.go:98 msg="inference compute" id=1 library=rocm compute=gfx1100 driver=0.0 name="AMD Radeon RX 7900 XTX" total="24.0 GiB" available="23.9 GiB"
```

After:
```
time=2024-06-18T16:15:27.513-07:00 level=INFO source=types.go:98 msg="inference compute" id=1 library=rocm compute=gfx1100 driver=5.7 name="AMD Radeon RX 7900 XTX" total="24.0 GiB" available="23.9 GiB"
```

fwiw, this version string doesn't seem to be wired to the actual driver version.    On this same test system:
```
Get-WmiObject Win32_VideoController | format-table Name, Description,VideoProcessor,DriverVersion

Name                    Description             VideoProcessor                         DriverVersion
----                    -----------             --------------                         -------------
AMD Radeon(TM) Graphics AMD Radeon(TM) Graphics AMD Radeon Graphics Processor (0x164E) 31.0.24019.1006
AMD Radeon RX 7900 XTX  AMD Radeon RX 7900 XTX  AMD Radeon Graphics Processor (0x744C) 31.0.24019.1006
```

Changed files:
filename: gpu/amd_hip_windows.go
patch: @@ -84,9 +84,8 @@ func (hl *HipLib) AMDDriverVersion() (driverMajor, driverMinor int, err error) {
 	}
 
 	slog.Debug("hipDriverGetVersion", "version", version)
-	// TODO - this isn't actually right, but the docs claim hipDriverGetVersion isn't accurate anyway...
-	driverMajor = version / 1000
-	driverMinor = (version - (driverMajor * 1000)) / 10
+	driverMajor = version / 10000000
+	driverMinor = (version - (driverMajor * 10000000)) / 100000
 
 	return driverMajor, driverMinor, nil
 }

filename: gpu/amd_windows.go
patch: @@ -35,12 +35,11 @@ func AMDGetGPUInfo() []RocmGPUInfo {
 	}
 	defer hl.Release()
 
-	// TODO - this reports incorrect version information, so omitting for now
-	// driverMajor, driverMinor, err := hl.AMDDriverVersion()
-	// if err != nil {
-	// 	// For now this is benign, but we may eventually need to fail compatibility checks
-	// 	slog.Debug("error looking up amd driver version", "error", err)
-	// }
+	driverMajor, driverMinor, err := hl.AMDDriverVersion()
+	if err != nil {
+		// For now this is benign, but we may eventually need to fail compatibility checks
+		slog.Debug("error looking up amd driver version", "error", err)
+	}
 
 	// Note: the HIP library automatically handles subsetting to any HIP_VISIBLE_DEVICES the user specified
 	count := hl.HipGetDeviceCount()
@@ -132,10 +131,8 @@ func AMDGetGPUInfo() []RocmGPUInfo {
 				MinimumMemory:  rocmMinimumMemory,
 				Name:           name,
 				Compute:        gfx,
-
-				// TODO - this information isn't accurate on windows, so don't report it until we find the right way to retrieve
-				// DriverMajor:    driverMajor,
-				// DriverMinor:    driverMinor,
+				DriverMajor:    driverMajor,
+				DriverMinor:    driverMinor,
 			},
 			index: i,
 		}
Repository: facebook/react
Pull request: Don't serialize chunk ids for Hint and Console rows

Hints and Console logs are side-effects and don't belong to any particular value. They're `void`. Therefore they don't need a row ID.

In the current parsing scheme it's ok to omit the id. It just becomes `0` which is the initial value which is then unused for these row types.

So it looks like:

```
:HP[...]
:W[...]
0:{...}
```

We could patch the parsing to encode the tag in the ID so it's more like the ID is the target of the side-effect.

```
H:P[...]
W:[...]
0:{...}
```

Or move the tagging to the beginning like it used to be.

But this seems simple enough for now.

Changed files:
filename: packages/react-server/src/ReactFlightServer.js
patch: @@ -213,11 +213,8 @@ function patchConsole(consoleInst: typeof console, methodName: string) {
           1,
         );
         request.pendingChunks++;
-        // We don't currently use this id for anything but we emit it so that we can later
-        // refer to previous logs in debug info to associate them with a component.
-        const id = request.nextChunkId++;
         const owner: null | ReactComponentInfo = resolveOwner();
-        emitConsoleChunk(request, id, methodName, owner, stack, arguments);
+        emitConsoleChunk(request, methodName, owner, stack, arguments);
       }
       // $FlowFixMe[prop-missing]
       return originalMethod.apply(this, arguments);
@@ -3227,8 +3224,7 @@ function emitHintChunk<Code: HintCode>(
   model: HintModel<Code>,
 ): void {
   const json: string = stringify(model);
-  const id = request.nextChunkId++;
-  const row = serializeRowHeader('H' + code, id) + json + '\n';
+  const row = ':H' + code + json + '\n';
   const processedChunk = stringToChunk(row);
   request.completedHintChunks.push(processedChunk);
 }
@@ -3764,7 +3760,6 @@ function outlineConsoleValue(
 
 function emitConsoleChunk(
   request: Request,
-  id: number,
   methodName: string,
   owner: null | ReactComponentInfo,
   stackTrace: ReactStackTrace,
@@ -3828,7 +3823,7 @@ function emitConsoleChunk(
       replacer,
     );
   }
-  const row = serializeRowHeader('W', id) + json + '\n';
+  const row = ':W' + json + '\n';
   const processedChunk = stringToChunk(row);
   request.completedRegularChunks.push(processedChunk);
 }
Repository: ggml-org/llama.cpp
Pull request: Changing default values of mmap and direct_io to false in llama-bench

When both are enabled by default the DirectIO path is used. By specifying mmap explicitly this behavior does not change. Therefore, with both parameters set to false as default, the DirectIO path and MMAP path can be enabled using the corresponding flag, without the need to disable the other. The default setting now uses `std::fread`. 

Before `--mmap 1 -dio 0` was needed to use mmap, now only `--mmap 1`. 


Changed files:
filename: tools/llama-bench/llama-bench.cpp
patch: @@ -372,8 +372,8 @@ static const cmd_params cmd_params_defaults = {
     /* devices              */ { {} },
     /* tensor_split         */ { std::vector<float>(llama_max_devices(), 0.0f) },
     /* tensor_buft_overrides*/ { std::vector<llama_model_tensor_buft_override>{ { nullptr, nullptr } } },
-    /* use_mmap             */ { true },
-    /* use_direct_io        */ { true },
+    /* use_mmap             */ { false },
+    /* use_direct_io        */ { false },
     /* embeddings           */ { false },
     /* no_op_offload        */ { false },
     /* no_host              */ { false },
Repository: vercel/next.js
Pull request: Don't invalidate hot reloader excessively during dev server boot

Suspecting that this fixes (or reduces) the "Watchpack Error (watcher): Error: EMFILE:" issues e.g. https://github.com/vercel/next.js/actions/runs/19028750529/job/54337767548?pr=85637

I noticed that all the Watchpack errors in CI happened in tests with a tsconfig (or ones where a tsconfig was created). When watchpack starts watching, an initial `aggregated` event is set. During that event we used to consider all files as changed because we hadn't seen them before. This also meant we considered the tsconfig as changed and invalidated the hot-reloader.

This is excessive and likely hits some hard to debug race conditions. Now we check if the file was actually changed since we started watching by comparing its change time to the time when we started watching. Each file modified before we started watching is no longer considered changed.

Changed files:
filename: packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
patch: @@ -371,6 +371,7 @@ async function startWatcher(
     const routeTypesFilePath = path.join(distDir, 'types', 'routes.d.ts')
     const validatorFilePath = path.join(distDir, 'types', 'validator.ts')
 
+    let initialWatchTime = performance.now() + performance.timeOrigin
     wp.on('aggregated', async () => {
       let writeEnvDefinitions = false
       let typescriptStatusFromLastAggregation = enabledTypeScript
@@ -445,14 +446,21 @@ async function startWatcher(
         const meta = knownFiles.get(fileName)
 
         const watchTime = fileWatchTimes.get(fileName)
+        const nextWatchTime = meta?.timestamp
         // If the file is showing up for the first time or the meta.timestamp is changed since last time
-        const watchTimeChange =
-          watchTime === undefined ||
-          (watchTime && watchTime !== meta?.timestamp)
-        fileWatchTimes.set(fileName, meta?.timestamp)
+        // Files that were created before we started watching are not considered changed.
+        // If any file was created by Next.js while booting, we assume those changes
+        // are handled in the bootstrap phase.
+        // Files that existed before we booted should be handled during bootstrapping.
+        const fileChanged =
+          (watchTime === undefined &&
+            (nextWatchTime === undefined ||
+              nextWatchTime >= initialWatchTime)) ||
+          (watchTime && watchTime !== nextWatchTime)
+        fileWatchTimes.set(fileName, nextWatchTime)
 
         if (envFiles.includes(fileName)) {
-          if (watchTimeChange) {
+          if (fileChanged) {
             envChange = true
           }
           continue
@@ -462,7 +470,7 @@ async function startWatcher(
           if (fileName.endsWith('tsconfig.json')) {
             enabledTypeScript = true
           }
-          if (watchTimeChange) {
+          if (fileChanged) {
             tsconfigChange = true
           }
           continue
Repository: ggml-org/llama.cpp
Pull request: CANN: Remove unused `ggml_cann_get_device` function

**Description of the problem**

Functions `ggml_cann_get_device` is declared and defined but never used.

**Proposed solution***

Remove its declaration and definition to reduce code size and improve maintainability.


Changed files:
filename: ggml/src/ggml-cann/common.h
patch: @@ -101,7 +101,6 @@ struct ggml_cann_device_info {
 const ggml_cann_device_info & ggml_cann_info();
 
 void    ggml_cann_set_device(int32_t device);
-int32_t ggml_cann_get_device();
 
 std::optional<std::string> get_env_as_lowercase(const std::string & name);
 bool                       parse_bool(const std::string & value);

filename: ggml/src/ggml-cann/ggml-cann.cpp
patch: @@ -93,17 +93,6 @@ void ggml_cann_set_device(const int32_t device) {
     g_current_cann_device = device;
 }
 
-/**
- * @brief Retrieves the current device ID.
- *
- * @return The current device ID.
- */
-int32_t ggml_cann_get_device() {
-    int32_t id;
-    ACL_CHECK(aclrtGetDevice(&id));
-    return id;
-}
-
 /**
  * @brief Get the value of the specified environment variable (name) as lowercase.
  *        if not empty, return a std::string object
Repository: vuejs/vue
Pull request: add options template tests

ref: #2872 


Changed files:
filename: src/entries/web-runtime-with-compiler.js
patch: @@ -26,7 +26,10 @@ Vue.prototype.$mount = function (el: string | Element): Component {
       } else if (template.nodeType) {
         template = template.innerHTML
       } else {
-        warn('invalid template option:' + template, this)
+        if (process.env.NODE_ENV !== 'production') {
+          warn('invalid template option:' + template, this)
+        }
+        return this
       }
     } else if (el) {
       template = getOuterHTML(el)

filename: test/unit/features/options/template.spec.js
patch: @@ -0,0 +1,53 @@
+import Vue from 'vue'
+
+describe('Options template', () => {
+  let el
+  beforeEach(() => {
+    el = document.createElement('script')
+    el.type = 'x-template'
+    el.id = 'app'
+    el.innerHTML = '<p>{{message}}</p>'
+    document.body.appendChild(el)
+  })
+
+  afterEach(() => {
+    document.body.removeChild(el)
+  })
+
+  it('basic usage', () => {
+    const vm = new Vue({
+      template: '<div>{{message}}</div>',
+      data: { message: 'hello world' }
+    }).$mount()
+    expect(vm.$el.tagName).toBe('DIV')
+    expect(vm.$el.textContent).toBe(vm.message)
+  })
+
+  it('id reference', () => {
+    const vm = new Vue({
+      template: '#app',
+      data: { message: 'hello world' }
+    }).$mount()
+    expect(vm.$el.tagName).toBe('P')
+    expect(vm.$el.textContent).toBe(vm.message)
+  })
+
+  it('DOM element', () => {
+    const elm = document.createElement('p')
+    elm.innerHTML = '<p>{{message}}</p>'
+    const vm = new Vue({
+      template: elm,
+      data: { message: 'hello world' }
+    }).$mount()
+    expect(vm.$el.tagName).toBe('P')
+    expect(vm.$el.textContent).toBe(vm.message)
+  })
+
+  it('invalid template', () => {
+    new Vue({
+      template: Vue,
+      data: { message: 'hello world' }
+    }).$mount()
+    expect('invalid template option').toHaveBeenWarned()
+  })
+})
Repository: vuejs/vue
Pull request: Fix render codegen issue

in #2953, I found the runtime error in `watcher`.
I fixed this issue.


Changed files:
filename: src/compiler/codegen.js
patch: @@ -225,6 +225,9 @@ function genText (text: ASTText | ASTExpression): string {
 }
 
 function genRender (el: ASTElement): string {
+  if (!el.renderMethod) {
+    return 'void 0'
+  }
   const children = genChildren(el)
   return `${el.renderMethod}(${
     el.renderArgs || ''

filename: test/unit/modules/compiler/codegen.spec.js
patch: @@ -117,6 +117,13 @@ describe('codegen', () => {
     )
   })
 
+  it('generate render tag with `method` is not dynamic binding', () => {
+    assertCodegen(
+      '<render method="onRender"></render>',
+      `with(this){return void 0}`
+    )
+  })
+
   it('generate single slot', () => {
     assertCodegen(
       '<slot></slot>',
Repository: huggingface/transformers
Pull request: Add AutoTokenizer mapping for mistral3 and ministral

# What does this PR do?

This PR makes sure that:

```py
from transformers import AutoTokenizer

tok = AutoTokenizer.from_pretrained("mistralai/Mistral-Small-3.2-24B-Instruct-2506")
tok = AutoTokenizer.from_pretrained("mistralai/Ministral-8B-Instruct-2410")
```

works correctly

Changed files:
filename: src/transformers/models/auto/tokenization_auto.py
patch: @@ -442,6 +442,15 @@
                 "GPT2TokenizerFast" if is_tokenizers_available() else None,
             ),
         ),
+        (
+            "ministral",
+            (
+                "MistralCommonTokenizer"
+                if is_mistral_common_available()
+                else ("LlamaTokenizer" if is_sentencepiece_available() else None),
+                "LlamaTokenizerFast" if is_tokenizers_available() and not is_mistral_common_available() else None,
+            ),
+        ),
         (
             "mistral",
             (
@@ -451,6 +460,15 @@
                 "LlamaTokenizerFast" if is_tokenizers_available() and not is_mistral_common_available() else None,
             ),
         ),
+        (
+            "mistral3",
+            (
+                "MistralCommonTokenizer"
+                if is_mistral_common_available()
+                else ("LlamaTokenizer" if is_sentencepiece_available() else None),
+                "LlamaTokenizerFast" if is_tokenizers_available() and not is_mistral_common_available() else None,
+            ),
+        ),
         (
             "mixtral",
             (
Repository: ollama/ollama
Pull request: Detect CUDA OS overhead

This adds logic to detect skew between the driver and
management library which can be attributed to OS overhead
and records that so we can adjust subsequent management
library free VRAM updates and avoid OOM scenarios.


Fixes #5504 

Changed files:
filename: gpu/gpu.go
patch: @@ -274,6 +274,28 @@ func GetGPUInfo() GpuInfoList {
 				gpuInfo.DriverMajor = driverMajor
 				gpuInfo.DriverMinor = driverMinor
 
+				// query the management library as well so we can record any skew between the two
+				// which represents overhead on the GPU we must set aside on subsequent updates
+				if cHandles.nvml != nil {
+					C.nvml_get_free(*cHandles.nvml, C.int(gpuInfo.index), &memInfo.free, &memInfo.total, &memInfo.used)
+					if memInfo.err != nil {
+						slog.Warn("error looking up nvidia GPU memory", "error", C.GoString(memInfo.err))
+						C.free(unsafe.Pointer(memInfo.err))
+					} else {
+						if memInfo.free != 0 && uint64(memInfo.free) > gpuInfo.FreeMemory {
+							gpuInfo.OSOverhead = uint64(memInfo.free) - gpuInfo.FreeMemory
+							slog.Info("detected OS VRAM overhead",
+								"id", gpuInfo.ID,
+								"library", gpuInfo.Library,
+								"compute", gpuInfo.Compute,
+								"driver", fmt.Sprintf("%d.%d", gpuInfo.DriverMajor, gpuInfo.DriverMinor),
+								"name", gpuInfo.Name,
+								"overhead", format.HumanBytes2(gpuInfo.OSOverhead),
+							)
+						}
+					}
+				}
+
 				// TODO potentially sort on our own algorithm instead of what the underlying GPU library does...
 				cudaGPUs = append(cudaGPUs, gpuInfo)
 			}
@@ -374,9 +396,14 @@ func GetGPUInfo() GpuInfoList {
 				slog.Warn("error looking up nvidia GPU memory")
 				continue
 			}
+			if cHandles.nvml != nil && gpu.OSOverhead > 0 {
+				// When using the management library update based on recorded overhead
+				memInfo.free -= C.uint64_t(gpu.OSOverhead)
+			}
 			slog.Debug("updating cuda memory data",
 				"gpu", gpu.ID,
 				"name", gpu.Name,
+				"overhead", format.HumanBytes2(gpu.OSOverhead),
 				slog.Group(
 					"before",
 					"total", format.HumanBytes2(gpu.TotalMemory),

filename: gpu/types.go
patch: @@ -52,7 +52,8 @@ type CPUInfo struct {
 
 type CudaGPUInfo struct {
 	GpuInfo
-	index int //nolint:unused,nolintlint
+	OSOverhead uint64 // Memory overhead between the driver library and management library
+	index      int    //nolint:unused,nolintlint
 }
 type CudaGPUInfoList []CudaGPUInfo
Repository: facebook/react
Pull request: s/server action/server function

## Overview

Changes the error message to say "Server Functions" instead of "Server Actions" since this error can fire in cases like:

```
<button onClick={serverFunction} />
```

Which is calling a server function, not a server action. 

Changed files:
filename: packages/react-client/src/ReactFlightReplyClient.js
patch: @@ -693,7 +693,7 @@ export function processReply(
       ) {
         if (temporaryReferences === undefined) {
           throw new Error(
-            'Only plain objects, and a few built-ins, can be passed to Server Actions. ' +
+            'Only plain objects, and a few built-ins, can be passed to Server Functions. ' +
               'Classes or null prototypes are not supported.' +
               (__DEV__ ? describeObjectForErrorMessage(parent, key) : ''),
           );

filename: scripts/error-codes/codes.json
patch: @@ -484,7 +484,7 @@
   "496": "Only objects or functions can be passed to taintObjectReference. Try taintUniqueValue instead.",
   "497": "Only objects or functions can be passed to taintObjectReference.",
   "498": "Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.%s",
-  "499": "Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported.%s",
+  "499": "Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported.%s",
   "500": "React expected a headers state to exist when emitEarlyPreloads was called but did not find it. This suggests emitEarlyPreloads was called more than once per request. This is a bug in React.",
   "501": "The render was aborted with postpone when the shell is incomplete. Reason: %s",
   "502": "Cannot read a Client Context from a Server Component.",
Repository: vuejs/vue
Pull request: add patch tests

ref: #2872


Changed files:
filename: test/helpers/vdom.js
patch: @@ -0,0 +1,5 @@
+import VNode from 'core/vdom/vnode'
+
+window.createTextVNode = function (text) {
+  return new VNode(undefined, undefined, undefined, text)
+}
Repository: ollama/ollama
Pull request: Remove duplicate merge glitch

Fixes #5594 

Changed files:
filename: llm/server.go
patch: @@ -254,10 +254,6 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
 		params = append(params, "--tensor-split", estimate.TensorSplit)
 	}
 
-	if estimate.TensorSplit != "" {
-		params = append(params, "--tensor-split", estimate.TensorSplit)
-	}
-
 	for i := range len(servers) {
 		dir := availableServers[servers[i]]
 		if dir == "" {
Repository: ollama/ollama
Pull request: cmd: display model transfer progress

`transferring model data 21% ⠸ `

Changed files:
filename: cmd/cmd.go
patch: @@ -77,7 +77,7 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 		return err
 	}
 
-	status := "transferring model data 0%"
+	status := "transferring model data"
 	spinner := progress.NewSpinner(status)
 	p.Add(status, spinner)
 	defer p.Stop()
@@ -312,7 +312,7 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string, spinner *pr
 			case <-ticker.C:
 				spinner.SetMessage(fmt.Sprintf("transferring model data %d%%", int(100*pw.n/fileSize)))
 			case <-done:
-				spinner.SetMessage(fmt.Sprintf("transferring model data done"))
+				spinner.SetMessage("transferring model data 100%")
 				return
 			}
 		}
Repository: huggingface/transformers
Pull request: New docker from AMD

This PR bumps the AMD docker base image because the last one was malfunctioning.  

Changed files:
filename: docker/transformers-pytorch-amd-gpu/Dockerfile
patch: @@ -1,4 +1,4 @@
-FROM rocm/pytorch:rocm7.0.2_ubuntu24.04_py3.12_pytorch_release_2.7.1
+FROM rocm/pytorch:rocm7.1_ubuntu22.04_py3.10_pytorch_release_2.8.0
 LABEL maintainer="Hugging Face"
 
 ARG DEBIAN_FRONTEND=noninteractive
Repository: ollama/ollama
Pull request: OpenAI v1/completions: allow stop token list

Resolves #5545 

Changed files:
filename: openai/openai.go
patch: @@ -338,12 +338,16 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) {
 	switch stop := r.Stop.(type) {
 	case string:
 		options["stop"] = []string{stop}
-	case []string:
-		options["stop"] = stop
-	default:
-		if r.Stop != nil {
-			return api.GenerateRequest{}, fmt.Errorf("invalid type for 'stop' field: %T", r.Stop)
+	case []any:
+		var stops []string
+		for _, s := range stop {
+			if str, ok := s.(string); ok {
+				stops = append(stops, str)
+			} else {
+				return api.GenerateRequest{}, fmt.Errorf("invalid type for 'stop' field: %T", s)
+			}
 		}
+		options["stop"] = stops
 	}
 
 	if r.MaxTokens != nil {

filename: openai/openai_test.go
patch: @@ -79,6 +79,7 @@ func TestMiddlewareRequests(t *testing.T) {
 					Model:       "test-model",
 					Prompt:      "Hello",
 					Temperature: &temp,
+					Stop:        []string{"\n", "stop"},
 				}
 
 				bodyBytes, _ := json.Marshal(body)
@@ -99,6 +100,16 @@ func TestMiddlewareRequests(t *testing.T) {
 				if genReq.Options["temperature"] != 1.6 {
 					t.Fatalf("expected 1.6, got %f", genReq.Options["temperature"])
 				}
+
+				stopTokens, ok := genReq.Options["stop"].([]any)
+
+				if !ok {
+					t.Fatalf("expected stop tokens to be a list")
+				}
+
+				if stopTokens[0] != "\n" || stopTokens[1] != "stop" {
+					t.Fatalf("expected ['\\n', 'stop'], got %v", stopTokens)
+				}
 			},
 		},
 	}