Repository navigation
Conversation
Each of Samudra's modules (convolution, batch norm, capped GELU, average pooling, zonally periodic bilinear upsampling with the skip connection) is a SQL function named after it, and each ConvNeXt block is a view. The check builds Samudra's own UNetBackbone and Samudra modules with random weights, at reduced width and depth, and runs them in float32. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyN7idACeDMh94qrnFMu6h
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Member
Author
|
🌀 Claude: The pushed script, run at 1 and 2 levels on a 10 × 20 grid. Measured on an i7-8700 with datafusion 55.0.0, DuckDB 1.5.6, einfold 0.2.0rc2 and torch 2.15.0 (CPU).
|
Each layer stored as a table before the next reads it, as PyTorch's eager mode keeps each activation, so that a view read twice is computed once. This is the fairer comparison with PyTorch; the views stay the demo's main path, since a gradient can be taken through them. Results print seconds to three significant figures, so PyTorch's milliseconds show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyN7idACeDMh94qrnFMu6h
This was referenced Nov 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A draft, opened early so the work is visible. This is demo 4 in
benchmarks/ml: Samudra 2's network written as SQL views, checked against Samudra's own PyTorch modules. Samudra is an emulator of the global ocean. Its network is a ConvNeXt U-Net: convolutions, batch norm, a capped GELU, average pooling, and zonally periodic bilinear upsampling. Toward #291 (a U-Net demo for einfold to optimize convolutions against).What's here
benchmarks/ml/04_samudra.py: each of Samudra's modules is a SQL function named after it, and each ConvNeXt block is a view over a state table(c, lat, lon, v).conv: each input cell, through each tap of the kernel, reaches the output cell the tap points to. Longitude wraps around the globe (modulo the grid's width), and latitude stops at the poles, which is Samudra's zero padding.batch_norm: the module's running statistics.capped_gelu: GELU capped at 10, witherfcomputed by Abramowitz and Stegun's formula 7.1.26 (error below 1.5e-7), since neither DataFusion nor DuckDB haserf.avg_pool: the mean of each 2 × 2 block of cells.upsample: each fine cell reads four coarse cells with bilinear weights, then adds the skip connection.The check builds Samudra's
UNetBackbone,ConvNeXtBlockandSamudramodules, as Samudra 2's configuration does, from m2lines/Samudra@4f86be4. They get random weights and batch-norm statistics at reduced width (4 to 10 channels), on a small grid, and run in float32.--levelssets the depth, from 1 to 4.First result, from the prototype at one level on a 10 × 18 grid: the forecast matches Samudra's PyTorch to 1.75e-7 relative on DataFusion, DuckDB and einfold. That's the error of the
erfformula.Found on the way
eliminate_cross_joindrops a join key that reads two tables of a cross join. The first spelling of the upsampling hit it. The upsampling now reads its source cells from a CTE, which is also the clearer spelling./on integers returns a float, and DataFusion has no//, so pooling writesfloor(lat / 2.0).signumand DuckDB hassign, so GELU usesCASE.decoder.weight) is read as a schema and a table, so parameter tables use underscores.samudra.modelspulls in Microsoft's Aurora, timm, torchvision and the data pipeline. This draft installs Samudra with--no-depsplus those packages.Not done yet
samudra @ git+…dependency pulls in all of Samudra's dependencies (numpy<2, skypilot, wandb, and others). CI needs a CPU build of PyTorch.tests/test_ml_demos.pylists the demo with no run until then.🤖 Generated with Claude Code
https://claude.ai/code/session_01NyN7idACeDMh94qrnFMu6h