feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327
feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327karthikreddy-02 wants to merge 7 commits intoapache:masterfrom
Conversation
…gister in model_info
…, tools) and fix forward() argument mismatch
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", | ||
| }, |
There was a problem hiding this comment.
Should append transformers_registered=True here.
There was a problem hiding this comment.
Hi @CRZbulabula! Thank you for the review. I have successfully resolved all your requests: fully formatted the code via black & isort, appended all Apache 2.0 license headers, modified the root LICENSE file, gracefully bypassed the CC-BY-NC-SA model weights download, and verified the successful SQL execution locally (screenshot attached).
| "toto", new FakeModelInfo("toto", "toto", "builtin", "active"))) | ||
| "toto", new FakeModelInfo("toto", "toto", "builtin", "active")), | ||
| new AbstractMap.SimpleEntry<>( | ||
| "patchtst_fm", new FakeModelInfo("patchtst_fm", "patchtst_fm", "builtin", "active"))) |
There was a problem hiding this comment.
Please revert updates in this file, because we cannot automatically download the model weight, CI for this model will never success.
There was a problem hiding this comment.
I have officially reverted AINodeTestUtils.java as requested! Thanks for catching that.
There was a problem hiding this comment.
It seems that you have disrupted the original Java code format. Please run mvn spotless:apply -P with-integration-tests in the project source root, otherwise all CI will fail.
…ipeline due to weight download restrictions
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)