Skip to content

feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327

Draft
karthikreddy-02 wants to merge 3 commits intoapache:masterfrom
karthikreddy-02:integration-patchtst-17301
Draft

feat(AINode): [Issue-17301] Import PatchTST-FM-R1 architecture and re…#17327
karthikreddy-02 wants to merge 3 commits intoapache:masterfrom
karthikreddy-02:integration-patchtst-17301

Conversation

@karthikreddy-02
Copy link

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)

Copy link
Contributor

@CRZbulabula CRZbulabula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The code style of AINode is guarded via black and isort. Thus, you should run these tool under the iotdb-core/ainode folder. To install them, I recommend you to setup a python virtual environment first, then execute poetry lock -vvv & poetry install -vvv under the iotdb-core/ainode folder.
  2. 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.
  3. 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_directory in iotdb-core/ainode/iotdb/ainode/core/model/model_storage.py, should skip this model.
  4. You should update the LICENSE file in project root to clarify your integration.
  5. 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",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should append transformers_registered=True here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants