Selected changesmerged Oct 22, 2026 – Oct 28, 2026
feat(common): add build_module for configurable sub-module blocksPython · 87 + / 2 −
Introduces 6 new declarations in nemo/collections/common/parts/utils.py.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
nemo/collections/common/parts/utils.py ↗ · 2 files
@@ -35,8 +47,81 @@ "swish": nn.SiLU, "silu": nn.SiLU, "gelu": nn.GELU,+ "squared_relu": SquaredReLU, } +ModuleBlock = Callable[..., nn.Module] | functools.partial | Mapping+++def build_module(block: ModuleBlock, **defaults: Any) -> nn.Module:+ """Instantiate a configurable sub-module of a parent module.++ Args:+ block: what builds the module:+ a class or callable returning it,+ a ``functools.partial`` of one+ (what Hydra creates for a config section with ``_target_`` and ``_partial_: true``),+ or such a config section itself, resolved through ``safe_instantiate``.+ defaults: the arguments the parent supplies, such as sizes and dropout rates;+ arguments bound in the partial or the section take precedence, by keyword or by position,+ so a section only names what deviates from the parent's defaults.++ Returns:+ The instantiated module.+ """+ if isinstance(block, Mapping):+ block = _section_partial(block)+ if isinstance(block, functools.partial):+ positional = _positional_names(block)+ keywords = {name: value for name, value in defaults.items() if name not in positional}+ keywords.update(block.keywords)+ return block.func(*block.args, **keywords)+ return block(**defaults)
ENH: Add `np.ma.assert_array_equal`Python · 125 + / 1 −
Introduces 3 new declarations in numpy/ma/core.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
numpy/ma/core.py ↗ · 7 files
@@ -8744,6 +8745,129 @@ def allclose(a, b, masked_equal=True, rtol=1e-5, atol=1e-8): return np.all(d) +def assert_array_equal(actual, desired, err_msg='', verbose=True, *,+ strict=False):+ """+ Raises an AssertionError if two masked arrays are not equal.++ Given two array_like objects, check that their masks are equal and that+ their data is equal wherever it is not masked. Unlike+ `numpy.testing.assert_array_equal`, which ignores masked values, a value+ that is masked in only one of the objects is reported as a mismatch.+ Objects that are not masked arrays are treated as having no masked+ values. As in `numpy.testing.assert_array_equal`, NaNs in the same+ unmasked positions are considered equal, and a scalar is compared with+ every element of an array unless `strict` is set.++ .. versionadded:: 2.6.0++ Parameters+ ----------+ actual : array_like+ The actual object to check.+ desired : array_like+ The desired, expected object.+ err_msg : str, optional+ The error message to be printed in case of failure.+ verbose : bool, optional+ If True, the conflicting values are appended to the error message.+ strict : bool, optional+ If True, raise an AssertionError when either the shape or the data+ type of the array_like objects does not match, and disable the+ special handling of scalars.
ENH: implement ExtensionArray.__array_function__ (GH#26380)Python · 80 + / 0 −
Introduces 4 new declarations in pandas/core/arrays/base.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
pandas/core/arrays/base.py ↗ · 5 files
@@ -3235,6 +3268,53 @@ def _groupby_first_last( return self.take(result_indices, allow_fill=True) +# -----------------------------------------------------------------------------+# __array_function__ helpers++# True while ExtensionArray.__array_function__ is handling a call+_IN_ARRAY_FUNCTION = contextvars.ContextVar("_IN_ARRAY_FUNCTION", default=False)+++# Overrides so these keep the extension dtype. Returning NotImplemented falls+# back to numpy's implementation.+++def _delete(arr, obj, axis=None):+ # the ExtensionArray may be obj rather than arr+ if (+ not isinstance(arr, ExtensionArray)+ or arr.ndim != 1+ or axis not in (None, 0, -1)+ ):+ return NotImplemented+ return arr.delete(obj)+++def _concatenate(arrays, axis=0, out=None, dtype=None, casting="same_kind"):+ if (+ not isinstance(arrays, (list, tuple))+ or not arrays+ or axis not in (None, 0, -1)+ or out is not None+ or dtype is not None+ or casting != "same_kind"
Add webpack utilsTypeScript · 650 + / 0 −
Introduces 14 new declarations in turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders-utils.ts.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders-utils.ts ↗ · 12 files
@@ -0,0 +1,648 @@+import { createHash as nodeCreateHash } from 'crypto'+import path from 'path'++const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/++function relativePathToRequest(relativePath: string): string {+ if (relativePath === '') return './.'+ if (relativePath === '..') return '../.'+ if (relativePath.startsWith('../')) return relativePath+ return `./${relativePath}`+}++// Matches webpack's lib/util/identifier.js, including regexp-like requests.+function absoluteToRequest(context: string, request: string): string {+ const windows = WINDOWS_ABS_PATH_REGEXP.test(request)+ if (!windows && request[0] !== '/') return request+ if (!windows && request.length > 1 && request.endsWith('/')) return request++ const queryIndex = request.indexOf('?')+ const resource = queryIndex === -1 ? request : request.slice(0, queryIndex)+ let relative = windows+ ? path.win32.relative(context, resource)+ : path.posix.relative(context, resource)+ if (!windows || !WINDOWS_ABS_PATH_REGEXP.test(relative)) {+ relative = relativePathToRequest(+ windows ? relative.replace(/\\/g, '/') : relative+ )+ }+ return relative + (queryIndex === -1 ? '' : request.slice(queryIndex))+}++export function contextify(context: string, request: string): string {+ return request
[Fix] Fix NUMA and cpuset detection in CBPython · 80 + / 9 −
Introduces 3 new declarations in src/transformers/generation/continuous_batching/utils.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
src/transformers/generation/continuous_batching/utils.py ↗ · 2 files
@@ -319,6 +325,73 @@ def memory_pool_context(mem_pool: Any) -> AbstractContextManager: # --------------------------------------------------- MEMORY UTILS --------------------------------------------------- # +def _parse_numa_node_list(node_list: str) -> set[int]:+ """Parses a node list in the kernel format, e.g. "0-1,3" -> {0, 1, 3}."""+ nodes = set()+ for node_range in node_list.split(","):+ first_node, _, last_node = node_range.partition("-")+ nodes.update(range(int(first_node), int(last_node or first_node) + 1))+ return nodes+++def _get_allowed_numa_nodes() -> set[int]:+ """Returns the NUMA nodes the process can allocate memory from, i.e. the nodes allowed both by its cpuset (cgroups,+ `docker --cpuset-mems`, ...) and by its memory policy (`numactl --membind`, ...). Returns an empty set if they+ cannot be read, e.g. if we are not on Linux or there is no NUMA support."""+ allowed_sets: list[set[int]] = []++ # Retrieve the allowed nodes from the cpuset+ mems_allowed = None+ try:+ # The cpuset restricts memory to the nodes in "Mems_allowed_list: <nodes>"+ with open("/proc/self/status", encoding="utf-8", errors="replace") as f:+ for line in f:+ if line.startswith("Mems_allowed_list:"):+ mems_allowed = line.split(":")[1].strip()+ break+ except OSError:+ pass++ if mems_allowed is not None:+ allowed_sets.append(_parse_numa_node_list(mems_allowed))+
Pass initial events through input channel preparing for moving the initial event fetching to separate goroutineGo · 69 + / 34 −
Introduces 3 new declarations in staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go.
Adds new systems design rather than adjusting what was there. Tests changed with it, with code of their own.
staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go ↗ · 3 files
@@ -466,22 +472,60 @@ func (c *cacheWatcher) sendWatchCacheEvent(event *watchCacheEvent) (builtAt, sen return builtAt, sentAt } -func (c *cacheWatcher) process(ctx context.Context, cacheInterval *watchCacheInterval) {+func (c *cacheWatcher) process(ctx context.Context) { defer utilruntime.HandleCrashWithContext(ctx) defer close(c.result) defer c.Stop()+ initialized := false+ var resourceVersion uint64 - if err := c.processInitialEvents(cacheInterval); err != nil {- return+ for {+ select {+ case item, ok := <-c.input:+ if !ok {+ return+ }+ switch {+ case item.interval != nil:+ if initialized {+ klog.ErrorS(nil, "Unexpected interval after watch was already initialized", "resource", c.groupResource, "identifier", c.identifier)+ if consistency.PanicOnCacheInconsistency {+ panic(fmt.Sprintf("Unexpected interval after watch was already initialized, resource: %q, identifier: %q", c.groupResource, c.identifier))+ }+ return+ }+ if err := c.processInitialEvents(item.interval); err != nil {+ return+ }+ resourceVersion = item.interval.resourceVersion+ // At this point we already start processing incoming watch events.
zlib: skip the stream in sync convenience calls without optionsJavaScript · 162 + / 19 −
Introduces 8 new declarations in lib/zlib.js.
Adds new runtime rather than adjusting what was there. Tests changed with it, with code of their own.
lib/zlib.js ↗ · 2 files
@@ -176,43 +177,128 @@ function zlibBufferOnEnd() { this.cb(null, buf); } -function zlibBufferSync(engine, buffer) {+function toSyncInput(buffer) { if (typeof buffer === 'string') {- buffer = Buffer.from(buffer);- } else if (!isArrayBufferView(buffer)) {+ return Buffer.from(buffer);+ }+ if (!isArrayBufferView(buffer)) { if (isAnyArrayBuffer(buffer)) {- buffer = Buffer.from(buffer);- } else {- throw new ERR_INVALID_ARG_TYPE(- 'buffer',- ['string', 'Buffer', 'TypedArray', 'DataView', 'ArrayBuffer'],- buffer,- );+ return Buffer.from(buffer); }+ throw new ERR_INVALID_ARG_TYPE(+ 'buffer',+ ['string', 'Buffer', 'TypedArray', 'DataView', 'ArrayBuffer'],+ buffer,+ ); }+ return buffer;+}++function zlibBufferSync(engine, buffer) {+ buffer = toSyncInput(buffer); buffer = processChunkSync(engine, buffer, engine._finishFlushFlag);
parse inline and rustc_force_inline with same parserRust · 136 + / 106 −
Introduces 4 new declarations in compiler/rustc_attr_parsing/src/attributes/inline.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_attr_parsing/src/attributes/inline.rs ↗ · 3 files
@@ -3,125 +3,156 @@ use rustc_feature::AttributeStability; use rustc_lint_defs::builtin::{ILL_FORMED_ATTRIBUTE_INPUT, UNUSED_ATTRIBUTES}; use super::prelude::*;-use crate::diagnostics::{InlineForceInlineConflict, InlineIgnoredForExported};+use crate::diagnostics::{InlineForceInlineConflict, InlineIgnoredForExported, UnusedMultiple}; -pub(crate) struct InlineParser;+#[derive(Default)]+pub(crate) struct InlineParser(Option<(InlineAttr, Span)>); -impl SingleAttributeParser for InlineParser {- const PATH: &[Symbol] = &[sym::inline];- const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;- const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[- Allow(Target::Fn),- Allow(Target::Method(MethodKind::Inherent)),- Allow(Target::Method(MethodKind::Trait { body: true })),- Allow(Target::Method(MethodKind::TraitImpl)),- Allow(Target::Closure),- Allow(Target::Delegation { mac: false }),- Warn(Target::Method(MethodKind::Trait { body: false })),- Warn(Target::ForeignFn),- Warn(Target::Field),- Warn(Target::MacroDef),- Warn(Target::Arm),- Warn(Target::AssocConst(AssocCtxt::Impl { of_trait: false })),- Warn(Target::AssocConst(AssocCtxt::Trait)),- Warn(Target::AssocConst(AssocCtxt::Impl { of_trait: true })),- Warn(Target::MacroCall),- ]);- const TEMPLATE: AttributeTemplate = template!(- Word,- List: &["always", "never"],
suggest named lifetimes instead of `'_` in `use<...>` for E0700Rust · 247 + / 69 −
Introduces 13 new declarations in compiler/rustc_trait_selection/src/error_reporting/infer/region.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_trait_selection/src/error_reporting/infer/region.rs ↗ · 8 files
@@ -1169,6 +1110,101 @@ pub(super) fn note_and_explain_region<'tcx>( emit_msg_span(err, prefix, description, span, suffix); } +fn suggest_name_regions<'tcx>(+ tcx: TyCtxt<'tcx>,+ generic_param_scope: LocalDefId,+ lifetimes: &[Region<'tcx>],+ add_lt_suggs: &mut Vec<(Span, String)>,+) -> Option<Vec<String>> {+ struct LifetimeReplaceVisitor<'a> {+ new_lts: &'a [(LocalDefId, String)],+ add_lt_suggs: &'a mut Vec<(Span, String)>,+ }++ impl<'hir> hir::intravisit::Visitor<'hir> for LifetimeReplaceVisitor<'_> {+ fn visit_lifetime(&mut self, lt: &'hir hir::Lifetime) {+ if let hir::LifetimeKind::Param(def_id) = lt.kind+ && let Some((_, new_lt)) = self.new_lts.iter().find(|(id, _)| *id == def_id)+ {+ self.add_lt_suggs.push(lt.suggestion(new_lt));+ }+ }+ }++ let mut lifetime_scope = None;+ let mut used_names = vec![];+ let mut new_lts: Vec<(LocalDefId, String)> = vec![];+ let names: Vec<_> = lifetimes+ .iter()+ .map(|&lifetime| {+ let (lifetime_def_id, scope) =+ match tcx.is_suitable_region(generic_param_scope, lifetime) {+ Some(info) if !lifetime.is_named(tcx) => {
Add a CLI for reviewing agent feedbackTypeScript · 256 + / 0 −
Introduces 9 new declarations in packages/next/src/cli/internal/agent-feedback.ts.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
packages/next/src/cli/internal/agent-feedback.ts ↗ · 7 files
@@ -0,0 +1,243 @@+import type { ChildProcess, SpawnOptions } from 'child_process'+import { addAbortSignal, type Readable } from 'stream'++import spawn from 'next/dist/compiled/cross-spawn'+import { z } from 'next/dist/compiled/zod'++const AGENT_FEEDBACK_REVIEW_URL = 'https://nextjs.org/agent-feedback#report='+const MAX_AGENT_FEEDBACK_INPUT_BYTES = 16 * 1024+const AGENT_FEEDBACK_INPUT_TIMEOUT_MS = 5_000++type SpawnReviewForm = (+ command: string,+ args: string[],+ options: SpawnOptions+) => ChildProcess++type FeedbackInput = Readable & {+ isTTY?: boolean+}++export type NextFeedbackOptions = {+ dryRun?: boolean+}++const agentFeedbackReportFields = {+ triggerReason: z.enum([+ 'unexpected-behavior',+ 'documentation-mismatch',+ 'misleading-error',+ 'repeated-failed-approach',+ 'non-obvious-workaround',+ ]),+ title: z.string().min(1).max(100),
feat(core): add the Muon optimizer with an AdamW fallbackPython · 351 + / 0 −
Introduces 9 new declarations in nemo/core/optim/muon.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
nemo/core/optim/muon.py ↗ · 7 files
@@ -0,0 +1,314 @@+# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.++"""Muon optimizer (MomentUm Orthogonalized by Newton-Schulz) with an AdamW fallback.++Muon (Keller Jordan et al., 2024, https://kellerjordan.github.io/posts/muon/) updates a weight matrix+with an approximately semi-orthogonal matrix derived from the momentum-averaged gradient,+computed with a quintic Newton-Schulz iteration in bfloat16.+Parameters that are not matrices (biases, normalization scales, convolution filters)+and matrices with a dimension of at least ``adam_dim_threshold`` (large embeddings and output projections)+are updated with AdamW at a fixed fraction of the learning rate,+as the public reference trainings (modded-nanogpt, nanochat) do with their embeddings and heads.+An embedding below the threshold is a matrix like any other and takes the Muon update+unless its parameter group sets ``use_muon=False``, see :class:`Muon`.+One optimizer instance handles both kinds,+so one learning-rate schedule drives both with a fixed ratio.+"""++from typing import Any, Callable, Dict, Iterable, Optional, Sequence, Tuple, Union++import torch
🚨Add an FP8 backend to `QuantizedCache`Python · 144 + / 27 −
Introduces 14 new declarations in src/transformers/cache_utils.py.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
src/transformers/cache_utils.py ↗ · 6 files
@@ -919,6 +941,76 @@ def _dequantize(self, qtensor): return tensor +class Fp8QuantizedLayer(BaseQuantizedLayer):+ """+ A quantized layer storing the key and value states in 8-bit floating point. The per-tensor scale is frozen+ after the first `update`, so new states are appended as-is: no residual cache, no re-quantization.++ A finer-grained variant belongs here rather than under `QuantizedLayer`, as grouping along the head+ dimension keeps states appendable and only turns the stored scale into a tensor.+ """++ fp8_dtype = torch.float8_e4m3fn+ fp8_max = torch.finfo(fp8_dtype).max++ def lazy_initialization(self, key_states: torch.Tensor, value_states: torch.Tensor) -> None:+ super().lazy_initialization(key_states, value_states)+ self._quantized_keys = self._quantize(key_states)+ self._quantized_values = self._quantize(value_states)++ def _quantize(self, tensor, scale=None):+ """Quantize `tensor` to FP8, calibrating the scale on its amplitude if it is not provided."""+ if scale is None:+ # `clamp` guards against an all-zeros tensor, which would give a null scale+ scale = (tensor.abs().amax().float() / self.fp8_max).clamp(min=torch.finfo(torch.float32).tiny)+ return (tensor.float() / scale).to(self.fp8_dtype), scale++ def _dequantize(self, qtensor):+ quant_tensor, scale = qtensor+ return (quant_tensor.float() * scale).to(self.dtype)++ def update(+ self, key_states: torch.Tensor, value_states: torch.Tensor, *args, **kwargs