Eliaaazzz opened a new pull request, #17383:
URL: https://github.com/apache/iotdb/pull/17383

   ## Summary
   
   Integrate [MOMENT](https://arxiv.org/abs/2402.03885) (A Family of Open 
Time-series Foundation Models, ICML 2024) into IoTDB AINode as a built-in time 
series foundation model.
   
   MOMENT is developed by Auton Lab, Carnegie Mellon University. It uses a **T5 
encoder-only** backbone with patch-based input embedding and RevIN 
normalization, supporting zero-shot and fine-tuned forecasting for univariate 
and multivariate time series.
   
   ### Key Changes
   
   - **New model package** 
(`iotdb-core/ainode/iotdb/ainode/core/model/moment/`):
     - `configuration_moment.py` — `MomentConfig` extending HuggingFace 
`PretrainedConfig`
     - `modeling_moment.py` — `MomentForPrediction` wrapping the MOMENT 
backbone (RevIN + Patching + T5 Encoder + ForecastingHead) as a 
`PreTrainedModel`
     - `pipeline_moment.py` — `MomentPipeline` extending `ForecastPipeline` 
with padding/truncation to fixed 512-length input, input mask construction, and 
iterative long-horizon forecasting
   - **Model registration** in `BUILTIN_HF_TRANSFORMERS_MODEL_MAP` with 
`repo_id=AutonLab/MOMENT-1-small`
   - **Memory estimate** added to `AINODE_INFERENCE_MODEL_MEM_USAGE_MAP` (~200 
MiB for MOMENT-1-small)
   - **Integration test** updated in `AINodeTestUtils.java`
   - **LICENSE** updated with MIT attribution for MOMENT source code
   - **Bug fix**: Quoted `$JAVA` variable in `confignode-env.sh` and 
`datanode-env.sh` to fix startup failure when `JAVA_HOME` contains spaces
   
   ### Architecture
   
   ```
   Input [batch, n_channels, 512]
     → RevIN normalization (channel-independent)
     → Patching (patch_len=8, stride=8 → 64 patches)
     → Patch embedding (linear projection to d_model)
     → T5 Encoder (self-attention layers)
     → Layer norm
     → ForecastingHead (linear projection to forecast_horizon)
     → RevIN denormalization
     → Output [batch, n_channels, forecast_horizon]
   ```
   
   ### Model Variants
   
   | Variant | HuggingFace Repo | d_model | Layers | Size |
   |---------|-----------------|---------|--------|------|
   | Small (default) | `AutonLab/MOMENT-1-small` | 512 | 8 | ~152 MB |
   | Base | `AutonLab/MOMENT-1-base` | 768 | 12 | ~900 MB |
   | Large | `AutonLab/MOMENT-1-large` | 1024 | 24 | ~1.39 GB |
   
   ## Test plan
   
   - [ ] Verify AINode compiles successfully with `mvn clean package -pl 
iotdb-core/ainode -P with-ainode -am -DskipTests`
   - [ ] Start IoTDB cluster + AINode, confirm `moment` appears in `SHOW MODELS`
   - [ ] Run forecast query: `SELECT * FROM FORECAST(model_id => 'moment', 
targets => (...), output_length => 96)`
   - [ ] Verify integration tests pass
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to