helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Turbopack: Use single write to loader ipc socket

## Optimize IPC message serialization in Turbopack

### What?
Optimizes the IPC message serialization by combining multiple buffer operations into a single buffer creation.

### Why?
The previous implementation created separate buffers for the message length and content, requiring two write operations. This change improves efficiency by creating a single buffer with space for the length prefix, then writing the length directly into that buffer.

As far as I can tell these writes were not guaranteed to be subsequent and the length did not have a write callback. 

### How?
- Creates a single buffer with "0000" placeholder prefix + the JSON message
- Writes the actual length (minus the 4-byte header) directly into the first 4 bytes
- Eliminates the need for a separate length buffer and reduces the number of write operations


Closes PACK-4424

Changed files:
filename: turbopack/crates/turbopack-node/js/src/ipc/index.ts
patch: @@ -96,10 +96,9 @@ function createIpc<TIncoming, TOutgoing>(
   });
 
   function send(message: any): Promise<void> {
-    const packet = Buffer.from(JSON.stringify(message), "utf8");
-    const length = Buffer.alloc(4);
-    length.writeUInt32BE(packet.length);
-    socket.write(length);
+    // Reserve 4 bytes for our length prefix, we will over-write after encoding.
+    const packet = Buffer.from("0000" + JSON.stringify(message), "utf8");
+    packet.writeUInt32BE(packet.length - 4, 0);
 
     return new Promise((resolve, reject) => {
       socket.write(packet, (err) => {
Repository: ggml-org/llama.cpp
Pull request: llava/mtmd : fixes to fully support dl backends


Changed files:
filename: tools/CMakeLists.txt
patch: @@ -27,11 +27,11 @@ else()
     add_subdirectory(run)
     add_subdirectory(tokenize)
     add_subdirectory(tts)
+    add_subdirectory(llava)
     if (NOT GGML_BACKEND_DL)
         # these examples use the backends directly and cannot be built with dynamic loading
         add_subdirectory(cvector-generator)
         add_subdirectory(export-lora)
-        add_subdirectory(llava)
         if (GGML_RPC)
             add_subdirectory(rpc)
         endif()

filename: tools/llava/clip.cpp
patch: @@ -3382,7 +3382,15 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima
             GGML_ABORT("Unknown projector type");
     }
 
-    ggml_backend_cpu_set_n_threads(ctx->backend_cpu, n_threads);
+    // ggml_backend_cpu_set_n_threads(ctx->backend_cpu, n_threads);
+    ggml_backend_dev_t dev = ggml_backend_get_device(ctx->backend_cpu);
+    ggml_backend_reg_t reg = dev ? ggml_backend_dev_backend_reg(dev) : nullptr;
+    if (reg) {
+        auto ggml_backend_set_n_threads_fn = (ggml_backend_set_n_threads_t) ggml_backend_reg_get_proc_address(reg, "ggml_backend_set_n_threads");
+        if (ggml_backend_set_n_threads_fn) {
+            ggml_backend_set_n_threads_fn(ctx->backend_cpu, n_threads);
+        }
+    }
 
     auto status = ggml_backend_sched_graph_compute(ctx->sched.get(), gf);
     if (status != GGML_STATUS_SUCCESS) {

filename: tools/llava/llava.cpp
patch: @@ -2,6 +2,7 @@
 #include "llava.h"
 
 #include "llama.h"
+#include "ggml-cpp.h"
 
 #include <algorithm>
 #include <cerrno>
@@ -209,7 +210,10 @@ static bool clip_llava_handle_patches(clip_ctx * ctx_clip, std::vector<float *>
     struct ggml_tensor *flatten = ggml_view_2d(model.ctx, permuted_cont, clip_n_mmproj_embd(ctx_clip), num_patches_height * num_patches_width * num_patches_per_side * num_patches_per_side,  size_ele * clip_n_mmproj_embd(ctx_clip), 0);
     // ggml_tensor_printf(flatten,"flatten",__LINE__,false,false);
     ggml_build_forward_expand(gf, flatten);
-    ggml_graph_compute_with_ctx(model.ctx, gf, 1);
+
+    ggml_backend_ptr backend { ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_CPU, nullptr) };
+    ggml_backend_graph_compute(backend.get(), gf);
+
     struct ggml_tensor* result = ggml_graph_node(gf, -1);
 
     memcpy(image_embd_out, image_embd_v[0], clip_embd_nbytes(ctx_clip)); // main image as global context
Repository: nodejs/node
Pull request: src,build: add no user defined deduction guides of CTAD check

To our [secondary C++ style guide](https://github.com/nodejs/node/blob/main/doc/contributing/cpp-style-guide.md#guides-and-references):

> Do not use CTAD with a given template unless the template's maintainers have opted into supporting use of CTAD by providing at least one explicit deduction guide (all templates in the std namespace are also presumed to have opted in). This should be enforced with a compiler warning if available.
> 
> Ref: https://google.github.io/styleguide/cppguide.html#CTAD

To use CTAD with a template, it must be defined with at least one deduction guide (`std` templates are defined with guides). Enforcing this rule with compiler checks.

Changed files:
filename: node.gyp
patch: @@ -482,6 +482,7 @@
         '-Wno-unused-parameter',
         '-Werror=undefined-inline',
         '-Werror=extra-semi',
+        '-Werror=ctad-maybe-unsupported',
       ],
     },
 

filename: node.gypi
patch: @@ -27,7 +27,11 @@
 
   'conditions': [
     [ 'clang==1', {
-      'cflags': [ '-Werror=undefined-inline', '-Werror=extra-semi']
+      'cflags': [
+        '-Werror=undefined-inline',
+        '-Werror=extra-semi',
+        '-Werror=ctad-maybe-unsupported',
+      ],
     }],
     [ '"<(_type)"=="executable"', {
       'msvs_settings': {

filename: src/quic/session.cc
patch: @@ -1531,7 +1531,7 @@ void Session::EmitDatagram(Store&& datagram, DatagramReceivedFlags flag) {
   DCHECK(!is_destroyed());
   if (!env()->can_call_into_js()) return;
 
-  CallbackScope cbv_scope(this);
+  CallbackScope<Session> cbv_scope(this);
 
   Local<Value> argv[] = {datagram.ToUint8Array(env()),
                          v8::Boolean::New(env()->isolate(), flag.early)};
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix race condition in MMQ stream-k fixup

Follow-up to https://github.com/ggml-org/llama.cpp/pull/13294 . I forgot that the stream-k fixup would suffer from the same problem.

Changed files:
filename: ggml/src/ggml-cuda/mmq.cuh
patch: @@ -2958,6 +2958,7 @@ static __global__ void mul_mat_q_stream_k_fixup(
     for (int j = threadIdx.y*WARP_SIZE + threadIdx.x; j < mmq_x; j += nwarps*WARP_SIZE) {
         ids_dst_shared[j] = ids_dst[col_low + j];
     }
+    __syncthreads();
 
     const int offset_dst = it*mmq_y;
     dst += offset_dst;
Repository: vercel/next.js
Pull request: Update Turbopack development test manifest

This auto-generated PR updates the development integration test manifest used when testing Turbopack.

Changed files:
filename: test/turbopack-dev-tests-manifest.json
patch: @@ -11246,7 +11246,7 @@
     "flakey": [],
     "runtimeError": false
   },
-  "test/e2e/socket-io/index.test.js": {
+  "test/e2e/socket-io/index.test.ts": {
     "passed": [
       "socket-io should support socket.io without falling back to polling"
     ],
Repository: huggingface/transformers
Pull request: fix: Restore explicit error surfacing for unexpected hub exceptions

Prior to PR #36033, unexpected exceptions (e.g., ModuleNotFoundError) during hub model loading were not swallowed silently. They either matched specific except blocks or were raised.

After #36033, a catch-all except Exception block was introduced without a fallback else, causing unknown errors to be silently ignored and leading to misleading downstream behavior.

This commit adds an `else: raise e` to ensure only explicitly handled exceptions are suppressed. All others are surfaced, restoring pre-4.50 behavior and aiding in debugging and dependency visibility.

Fixes #37477, see my last comment there for more details.

Since I am new here, I appreciate reviews :)
Should a test for proper exceptions be written so this kind of regression does not happen again?



## Who can review?

@gante @Cyrilvallez @Wauplin 

Changed files:
filename: src/transformers/utils/hub.py
patch: @@ -551,6 +551,10 @@ def cached_files(
             if not _raise_exceptions_for_connection_errors:
                 return None
             raise OSError(f"There was a specific connection error when trying to load {path_or_repo_id}:\n{e}")
+        # Any other Exception type should now be re-raised, in order to provide helpful error messages and break the execution flow
+        # (EntryNotFoundError will be treated outside this block and correctly re-raised if needed)
+        elif not isinstance(e, EntryNotFoundError):
+            raise e
 
     resolved_files = [
         _get_cache_file_to_return(path_or_repo_id, filename, cache_dir, revision) for filename in full_filenames
Repository: vercel/next.js
Pull request: test: flake debugging - avoid logs being eaten by jest

follow up to #78424. annoyingly, it appears that the console.log output gets swallowed by jest somehow, so i'm using `require('console')` instead which jest doesn't instrument.

Changed files:
filename: test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
patch: @@ -99,6 +99,7 @@ describe('app dir - rsc basics', () => {
         stripHTMLComments($('#return-undefined-layout').html())
       ).toBeEmpty()
     } catch (err) {
+      const console = require('console')
       const sep = '='.repeat(40) + ' PAGE HTML ' + '='.repeat(40)
       console.log()
       console.log(sep)
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix race condition in MMQ ids_dst

Fixes https://github.com/ggml-org/llama.cpp/issues/13287 .

Depending on the exact matrix shape and streaming multiprocessor count there can be a race condition on `ids_dst`. This PR adds the necessary calls to `__syncthreads` to eliminate these race conditions.

Changed files:
filename: ggml/src/ggml-cuda/mmq.cuh
patch: @@ -2636,6 +2636,7 @@ static __global__ void mul_mat_q(
 
         ids_dst_shared[j] = j;
     }
+    __syncthreads();
 
     // On AMD or old CUDA the performance with stream-k was worse, use conventional tiling instead:
 #if (defined(GGML_USE_HIP) && defined(__HIP_PLATFORM_AMD__)) || __CUDA_ARCH__ < GGML_CUDA_CC_VOLTA
@@ -2664,6 +2665,7 @@ static __global__ void mul_mat_q(
                 return;
             }
 
+            // __syncthreads(); // There is no previous tile that could cause a race condition.
 #pragma unroll
             for (int j0 = 0; j0 < mmq_x; j0 += nwarps*WARP_SIZE) {
                 const int j = j0 + threadIdx.y*WARP_SIZE + threadIdx.x;
@@ -2674,6 +2676,7 @@ static __global__ void mul_mat_q(
 
                 ids_dst_shared[j] = ids_dst[col_low + jt*mmq_x + j];
             }
+            __syncthreads();
         }
 
         offset_y   += (col_low + jt*mmq_x)*(sizeof(block_q8_1_mmq)/sizeof(int));
@@ -2740,6 +2743,7 @@ static __global__ void mul_mat_q(
                 continue;
             }
 
+            __syncthreads();
 #pragma unroll
             for (int j0 = 0; j0 < mmq_x; j0 += nwarps*WARP_SIZE) {
                 const int j = j0 + threadIdx.y*WARP_SIZE + threadIdx.x;
@@ -2750,6 +2754,7 @@ static __global__ void mul_mat_q(
 
                 ids_dst_shared[j] = ids_dst[col_low + jt*mmq_x + j];
             }
+            __syncthreads();
         }
 
         offset_y   += (col_low + jt*mmq_x)*(sizeof(block_q8_1_mmq)/sizeof(int));
@@ -2805,6 +2810,7 @@ static __global__ void mul_mat_q(
         }
 
         // The memory layout for the fixup buffer is always contiguous, therefore reset ids:
+        __syncthreads();
 #pragma unroll
         for (int j0 = 0; j0 < mmq_x; j0 += nwarps*WARP_SIZE) {
             const int j = j0 + threadIdx.y*WARP_SIZE + threadIdx.x;
@@ -2815,6 +2821,7 @@ static __global__ void mul_mat_q(
 
             ids_dst_shared[j] = j;
         }
+        __syncthreads();
     }
 
     offset_y   += (col_low + jt*mmq_x)*(sizeof(block_q8_1_mmq)/sizeof(int));
Repository: facebook/react
Pull request: Don't inject timeline hooks unless React supports profiling

This gives DevTools a way to detect whether the current React renderer supports Timeline profiling. (Version alone isn't enough to detect this, neither is general profiling support– since these two are controlled by different feature flags.)

Relates to #22529.

Changed files:
filename: packages/react-reconciler/src/ReactFiberDevToolsHook.new.js
patch: @@ -74,11 +74,19 @@ export function injectInternals(internals: Object): boolean {
     return true;
   }
   try {
-    rendererID = hook.inject({
-      ...internals,
-      getLaneLabelMap,
-      injectProfilingHooks,
-    });
+    if (enableSchedulingProfiler) {
+      // Conditionally inject these hooks only if Timeline profiler is supported by this build.
+      // This gives DevTools a way to feature detect that isn't tied to version number
+      // (since profiling and timeline are controlled by different feature flags).
+      internals = {
+        ...internals,
+        getLaneLabelMap,
+        injectProfilingHooks,
+      };
+    }
+
+    rendererID = hook.inject(internals);
+
     // We have successfully injected, so now it is safe to set up hooks.
     injectedHook = hook;
   } catch (err) {

filename: packages/react-reconciler/src/ReactFiberDevToolsHook.old.js
patch: @@ -74,11 +74,19 @@ export function injectInternals(internals: Object): boolean {
     return true;
   }
   try {
-    rendererID = hook.inject({
-      ...internals,
-      getLaneLabelMap,
-      injectProfilingHooks,
-    });
+    if (enableSchedulingProfiler) {
+      // Conditionally inject these hooks only if Timeline profiler is supported by this build.
+      // This gives DevTools a way to feature detect that isn't tied to version number
+      // (since profiling and timeline are controlled by different feature flags).
+      internals = {
+        ...internals,
+        getLaneLabelMap,
+        injectProfilingHooks,
+      };
+    }
+
+    rendererID = hook.inject(internals);
+
     // We have successfully injected, so now it is safe to set up hooks.
     injectedHook = hook;
   } catch (err) {
Repository: denoland/deno
Pull request: fix(urlpattern): correct typings for added APIs 


Changed files:
filename: ext/url/lib.deno_url.d.ts
patch: @@ -249,6 +249,20 @@ declare interface URLPatternResult {
   hash: URLPatternComponentResult;
 }
 
+/**
+ * Options for the {@linkcode URLPattern} constructor.
+ *
+ * @category URL
+ */
+declare interface URLPatternOptions {
+  /**
+   * Enables case-insensitive matching.
+   *
+   * @default {false}
+   */
+  ignoreCase: boolean;
+}
+
 /**
  * The URLPattern API provides a web platform primitive for matching URLs based
  * on a convenient pattern syntax.
@@ -343,6 +357,9 @@ declare interface URLPattern {
   readonly search: string;
   /** The pattern string for the `hash`. */
   readonly hash: string;
+
+  /** Whether or not any of the specified groups use regexp groups. */
+  readonly hasRegExpGroups: boolean;
 }
 
 /**
@@ -377,5 +394,10 @@ declare interface URLPattern {
  */
 declare var URLPattern: {
   readonly prototype: URLPattern;
-  new (input: URLPatternInput, baseURL?: string): URLPattern;
+  new (
+    input: URLPatternInput,
+    baseURL: string,
+    options?: URLPatternOptions,
+  ): URLPattern;
+  new (input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
 };
Repository: nodejs/node
Pull request: test: remove test-fs-utimes flaky designation

The issue is likely the same as other tests that time out.

Refs: https://github.com/nodejs/node/issues/54918
Refs: https://github.com/nodejs/node/pull/54844
Refs: https://github.com/nodejs/node/pull/54802

<!--
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: test/parallel/parallel.status
patch: @@ -43,8 +43,6 @@ test-esm-loader-hooks-inspect-wait: PASS, FLAKY
 test-sqlite-statement-sync: PASS, FLAKY
 # https://github.com/nodejs/node/issues/54534
 test-runner-run-watch: PASS, FLAKY
-# https://github.com/nodejs/node/issues/37692
-test-fs-utimes: PASS, FLAKY
 
 [$system==linux || $system==win32]
 # https://github.com/nodejs/node/issues/49605
Repository: huggingface/transformers
Pull request: quick fix fast_image_processor register error

# What does this PR do?

Fixes #36715 


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?

Changed files:
filename: src/transformers/models/auto/image_processing_auto.py
patch: @@ -24,7 +24,7 @@
 # Build the list of all image processors
 from ...configuration_utils import PretrainedConfig
 from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
-from ...image_processing_utils import BaseImageProcessor, ImageProcessingMixin
+from ...image_processing_utils import ImageProcessingMixin
 from ...image_processing_utils_fast import BaseImageProcessorFast
 from ...utils import (
     CONFIG_NAME,
@@ -607,8 +607,10 @@ def register(
             raise ValueError("You need to specify either slow_image_processor_class or fast_image_processor_class")
         if slow_image_processor_class is not None and issubclass(slow_image_processor_class, BaseImageProcessorFast):
             raise ValueError("You passed a fast image processor in as the `slow_image_processor_class`.")
-        if fast_image_processor_class is not None and issubclass(fast_image_processor_class, BaseImageProcessor):
-            raise ValueError("You passed a slow image processor in as the `fast_image_processor_class`.")
+        if fast_image_processor_class is not None and not issubclass(
+            fast_image_processor_class, BaseImageProcessorFast
+        ):
+            raise ValueError("The `fast_image_processor_class` should inherit from `BaseImageProcessorFast`.")
 
         if (
             slow_image_processor_class is not None
Repository: facebook/react
Pull request: Fix production-only updateSyncExternalStore() crash when doing setState in render

See T110284955 for context

Changed files:
filename: packages/react-reconciler/src/ReactFiberHooks.new.js
patch: @@ -2471,7 +2471,7 @@ const HooksDispatcherOnRerender: Dispatcher = {
   useDeferredValue: rerenderDeferredValue,
   useTransition: rerenderTransition,
   useMutableSource: updateMutableSource,
-  useSyncExternalStore: mountSyncExternalStore,
+  useSyncExternalStore: updateSyncExternalStore,
   useId: updateId,
 
   unstable_isNewReconciler: enableNewReconciler,

filename: packages/react-reconciler/src/ReactFiberHooks.old.js
patch: @@ -2471,7 +2471,7 @@ const HooksDispatcherOnRerender: Dispatcher = {
   useDeferredValue: rerenderDeferredValue,
   useTransition: rerenderTransition,
   useMutableSource: updateMutableSource,
-  useSyncExternalStore: mountSyncExternalStore,
+  useSyncExternalStore: updateSyncExternalStore,
   useId: updateId,
 
   unstable_isNewReconciler: enableNewReconciler,

filename: packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
patch: @@ -745,6 +745,33 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
     });
   });
 
+  test('regression test for #23150', async () => {
+    const store = createExternalStore('Initial');
+
+    function App() {
+      const text = useSyncExternalStore(store.subscribe, store.getState);
+      const [derivedText, setDerivedText] = useState(text);
+      useEffect(() => {}, []);
+      if (derivedText !== text.toUpperCase()) {
+        setDerivedText(text.toUpperCase());
+      }
+      return <Text text={derivedText} />;
+    }
+
+    const container = document.createElement('div');
+    const root = createRoot(container);
+    await act(() => root.render(<App />));
+
+    expect(Scheduler).toHaveYielded(['INITIAL']);
+    expect(container.textContent).toEqual('INITIAL');
+
+    await act(() => {
+      store.set('Updated');
+    });
+    expect(Scheduler).toHaveYielded(['UPDATED']);
+    expect(container.textContent).toEqual('UPDATED');
+  });
+
   // The selector implementation uses the lazy ref initialization pattern
   // @gate !(enableUseRefAccessWarning && __DEV__)
   test('compares selection to rendered selection even if selector changes', async () => {
Repository: huggingface/transformers
Pull request: Llama4: remove redundant transpose of router_logits

# What does this PR do?

This PR removes redundant transpose of router_logits

## Who can review?
cc @ArthurZucker


Changed files:
filename: src/transformers/models/llama4/modeling_llama4.py
patch: @@ -159,14 +159,12 @@ def __init__(self, config):
     def forward(self, hidden_states):
         batch, seq_len, hidden_dim = hidden_states.shape
         hidden_states = hidden_states.view(-1, self.hidden_dim)
-        router_logits = self.router(hidden_states).transpose(0, 1)
+        router_logits = self.router(hidden_states)
         tokens_per_expert = batch * seq_len
 
-        router_top_value, router_indices = torch.topk(router_logits.transpose(0, 1), self.top_k, dim=1)
+        router_top_value, router_indices = torch.topk(router_logits, self.top_k, dim=1)
         router_scores = (
-            torch.full_like(router_logits.transpose(0, 1), float("-inf"))
-            .scatter_(1, router_indices, router_top_value)
-            .transpose(0, 1)
+            torch.full_like(router_logits, float("-inf")).scatter_(1, router_indices, router_top_value).transpose(0, 1)
         )
         # We do this to make sure we have -inf for non topK tokens before going through the !
         # Here we are just creating a tensor to index each and every single one of the hidden states. Let s maybe register a buffer for this!