{"record":{"id":"e60b683c149c8c3c","repo":"jax-ml/jax","slug":"unsupported-transform-transform-e60b68","errorCode":null,"errorMessage":"Unsupported transform {transform}","messagePattern":"Unsupported transform (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/experimental/mosaic/gpu/layouts.py","lineNumber":156,"sourceCode":"def splat_is_compatible_with_tiled(\n    l1: fa.WGSplatFragLayout, l2: fa.TiledLayout\n) -> bool:\n  # A splat layout is compatible with a tiled layout up to replication if each\n  # dimension in the shape of the splat layout is divisible by the corresponding\n  # dimension in the base tile shape.\n  s1, s2 = l1.shape, l2.base_tile_shape\n  return all(d1 % d2 == 0 for d1, d2 in zip(s1, s2))\n\n\ndef to_transform_attr(\n    transform: launch_context.MemRefTransform | mgpu.SwizzlingMode,\n) -> ir.Attribute:\n  if isinstance(transform, launch_context.TileTransform):\n    return mgpu.TileTransformAttr.get(transform.tiling)\n  elif isinstance(transform, mgpu.SwizzlingMode):\n    return mgpu.SwizzleTransformAttr.get(transform)\n  else:\n    raise NotImplementedError(f\"Unsupported transform {transform}\")\n\n\ndef from_transform_attr(\n    transform: ir.Attribute,\n) -> launch_context.MemRefTransform | mgpu.SwizzlingMode:\n  if isinstance(transform, mgpu.TileTransformAttr):\n    return launch_context.TileTransform(\n        tuple(mgpu.TileTransformAttr(transform).tiling)\n    )\n  elif isinstance(transform, mgpu.SwizzleTransformAttr):\n    return mgpu.SwizzlingMode(mgpu.SwizzleTransformAttr(transform).swizzle)\n  else:\n    raise NotImplementedError(f\"Unsupported transform {transform}\")\n","sourceCodeStart":138,"sourceCodeEnd":170,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/experimental/mosaic/gpu/layouts.py#L138-L170","documentation":"to_transform_attr serializes a Python-side memory transform into an MLIR attribute, supporting only launch_context.TileTransform and mgpu.SwizzlingMode. Passing any other transform object raises NotImplementedError.","triggerScenarios":"Calling layout-to-MLIR conversion (e.g. when emitting tiled layouts with transforms) with a transform object that is neither TileTransform nor SwizzlingMode — often a custom transform class.","commonSituations":"Extending Mosaic with custom swizzle/transform schemes, or passing a raw mgpu attr where a Python object is expected.","solutions":["Convert your transform to launch_context.TileTransform or mgpu.SwizzlingMode before building the layout","For new transform kinds, add a branch to to_transform_attr in a fork/PR"],"exampleFix":"// before\ntransforms=(my_custom_transform,)\n// after\ntransforms=(launch_context.TileTransform((16, 16)), mgpu.SwizzlingMode.SWIZZLE_128B)","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def is_supported_transform(t):\n    return isinstance(t, (launch_context.TileTransform, mgpu.SwizzlingMode))","tryCatchPattern":null,"preventionTips":["Wrap custom transforms into TileTransform/SwizzlingMode before building layouts"],"tags":["jax","mosaic","transform","not-implemented"],"backgroundTag":"unsupported-transform-type","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}