feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327
Draft
karthikreddy-02 wants to merge 3 commits intoapache:masterfrom
Draft
feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327karthikreddy-02 wants to merge 3 commits intoapache:masterfrom
karthikreddy-02 wants to merge 3 commits intoapache:masterfrom
Conversation
…gister in model_info
…, tools) and fix forward() argument mismatch
CRZbulabula
requested changes
Mar 22, 2026
Contributor
CRZbulabula
left a comment
There was a problem hiding this comment.
Hi Karthik, this is your first PR (pull request) for Apache IoTDB repository, our community highly appreciate your contribution!
Next, let us talk about this PR. You have almost done all works to integrate the PatchTST-FM-R1 model for AINode. Nevertheless, the following points still need to be improved:
- The code style of AINode is guarded via
blackandisort. Thus, you should run these tool under theiotdb-core/ainodefolder. To install them, I recommend you to setup a python virtual environment first, then executepoetry lock -vvv & poetry install -vvvunder theiotdb-core/ainodefolder. - Given the whole project employs the Apache-2.0 License, you should append this license in the head of each file you created. For reference, you can click and compare any existed python file in the AINode module.
- The current version of AINode offers the ability of automatically downloading the weight and configuration files for each built-in timeseries foundation model. Unfortunally this function should be banned for PatchTST-FM-R1, considering the open source license conflict. To elaborate, the weight of this model is protected through CC-BY-NC-SA-4.0 license, while only its source code uses the Apache-2.0 license. Thus, the automatically download function, which you can refer from
_process_builtin_model_directoryiniotdb-core/ainode/iotdb/ainode/core/model/model_storage.py, should skip this model. - You should update the
LICENSEfile in project root to clarify your integration. - Since the weight of PatchTST-FM-R1 model cannot be introduced for AINode, you can only test you integration in your local environment. To demonstrate the correctness, please go through this model inference guide and provide test screenshot in your PR.
| auto_map={ | ||
| "AutoConfig": "configuration_patchtst_fm.PatchTSTFMConfig", | ||
| "AutoModelForCausalLM": "modeling_patchtst_fm.PatchTSTFMForPrediction", | ||
| }, |
Contributor
There was a problem hiding this comment.
Should append transformers_registered=True here.
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.
Description
This Draft PR tracks the integration of IBM's PatchTST-FM-R1 into the AINode built-in model registry, resolving Issue #17301.
Current Progress:
Imported custom patchtst_fm architecture files (
configuration_patchtst_fm.py
and
modeling_patchtst_fm.py
) from the IBM Granite TSFM repository, as they are not natively supported in standard transformers yet.
Registered the model in BUILTIN_HF_TRANSFORMERS_MODEL_MAP under
model_info.py
.
Next Steps (WIP):
Implement PatchTSTFMPipeline extending
ForecastPipeline
for tensor reshaping.
Add integration tests.
This PR has:
x been self-reviewed.
added documentation for new or modified features or behaviors.
added Javadocs for most classes and all non-trivial methods.
added or updated version, license, or notice information
added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
added integration tests.
been tested in a test IoTDB cluster.
Key changed/added classes (or packages if there are too many classes) in this PR
iotdb.ainode.core.model.patchtst_fm.configuration_patchtst_fm (Added)
iotdb.ainode.core.model.patchtst_fm.modeling_patchtst_fm (Added)
iotdb.ainode.core.model.model_info.BUILTIN_HF_TRANSFORMERS_MODEL_MAP (Modified)