Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(gen-ai): JumpStartSageMakerEndpoint not working #179

Closed
1 task done
LeonLuttenberger opened this issue Jan 8, 2024 · 1 comment · Fixed by #180
Closed
1 task done

(gen-ai): JumpStartSageMakerEndpoint not working #179

LeonLuttenberger opened this issue Jan 8, 2024 · 1 comment · Fixed by #180
Assignees
Labels
bug Something isn't working investigated p1

Comments

@LeonLuttenberger
Copy link

Describe the bug

I'm unable to deploy the SageMaker endpoint using the JumpStartSageMakerEndpoint construct.

Expected Behavior

The endpoint gets created.

Current Behavior

CloudFormation throws the following error when trying to create the endpoint:

Could not find model data at s3://jumpstart-cache-prod-us-east-1/huggingface-asr/huggingface-asr-whisper-base/artifacts/inference-prepack/v1.0.1/. (Service: AmazonSageMaker; Status Code: 400; Error Code: ValidationException; Request ID: 8e830934-e61a-4c1e-96e5-1663211204b0; Proxy: null)

error

Reproduction Steps

import * as cdk from "aws-cdk-lib";
import { Construct } from "constructs";
import {
  JumpStartModel,
  SageMakerInstanceType,
  JumpStartSageMakerEndpoint,
} from "@cdklabs/generative-ai-cdk-constructs";

export class SagemakerJumpStartFmEndpointStack extends cdk.Stack {
  jumpStartEndpoint: JumpStartSageMakerEndpoint;

  constructor(scope: Construct, id: string, props: SagemakerJumpStartFmEndpointStackProps) {
    super(scope, id, props);

    this.jumpStartEndpoint = new JumpStartSageMakerEndpoint(this, "JumpStartEndpoint", {
      model: JumpStartModel.HUGGINGFACE_ASR_WHISPER_BASE_2_0_0,
      instanceType: SageMakerInstanceType.of("ml.g5.2xlarge"),
    });
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.111.0

Framework Version

0.1.11

Node.js Version

21.4.0

OS

Mac OS

Language

Typescript

Language Version

No response

Region experiencing the issue

us-east-1

Code modification

No

Other information

No response

Service quota

  • I have reviewed the service quotas for this construct
@LeonLuttenberger LeonLuttenberger added bug Something isn't working needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2024
@LeonLuttenberger LeonLuttenberger changed the title (module name): (short issue description) (gen-ai): JumpStartSageMakerEndpoint not working Jan 8, 2024
@krokoko
Copy link
Collaborator

krokoko commented Jan 9, 2024

Hi @LeonLuttenberger, thank you for reporting this ! I was able to reproduce

Issue:
The construct is expecting to get the model artifacts as a single gzip compressed tar archive (.tar.gz suffix)
However, for some models, it is not the case. It seems to affect all models in version 2_0_0 or above.

The construct needs to handle this edge case

@krokoko krokoko added p1 investigated and removed needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2024
@krokoko krokoko self-assigned this Jan 11, 2024
krokoko added a commit that referenced this issue Jan 12, 2024
…emaker (#180)

* feat(construct): New construct CustomSagemakerEndpoint Fixes (New construct): Add support to deploy custom models to a sagemaker endpoint #150
* chore(construct): Update documentation
* feat(construct): Add new projen task to run the code generation step (create list of available containers / jumpstart models). Can be used through projen generate-models-containers
* chore(construct): Update list of available models
* fix(construct): Fixes (gen-ai): JumpStartSageMakerEndpoint not working #179 : address the issue of some models from JumpStart which can't be deployed. This is due to the construct requiring model data to be provided as a compressed object, however some newer JumpStart models provide uncompressed model artifacts. Tested the fix with the reported model - whisper base 2.0.0. Deployed model and ran inference. This requires an upgrade of cdk as the update to the L1 CloudFormation resource was added recently (addition of the property https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnModel.ModelDataSourceProperty.html)
oconpa pushed a commit to oconpa/generative-ai-cdk-constructs that referenced this issue Jan 16, 2024
…emaker (awslabs#180)

* feat(construct): New construct CustomSagemakerEndpoint Fixes (New construct): Add support to deploy custom models to a sagemaker endpoint awslabs#150
* chore(construct): Update documentation
* feat(construct): Add new projen task to run the code generation step (create list of available containers / jumpstart models). Can be used through projen generate-models-containers
* chore(construct): Update list of available models
* fix(construct): Fixes (gen-ai): JumpStartSageMakerEndpoint not working awslabs#179 : address the issue of some models from JumpStart which can't be deployed. This is due to the construct requiring model data to be provided as a compressed object, however some newer JumpStart models provide uncompressed model artifacts. Tested the fix with the reported model - whisper base 2.0.0. Deployed model and ran inference. This requires an upgrade of cdk as the update to the L1 CloudFormation resource was added recently (addition of the property https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnModel.ModelDataSourceProperty.html)
oconpa pushed a commit to oconpa/generative-ai-cdk-constructs that referenced this issue Jan 16, 2024
feat: combining all

parent 364274d
author github-actions <github-actions@github.com> 1702080482 +0000
committer Patrick <ocopatr@amazon.com> 1705428058 -0800

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7147565079

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7161144540

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

chore(doc): update documentation and generate new list of models to deploy

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7174960686

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

feat: qa concurrency props

fix(constructs): fix log group name

fix(lint): run linter

fix(lint): differentiate name

feat(doc): update readme with additional resources

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7228300421

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7255404764

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

chore(deps): upgrade dependencies

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7325128447

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>

chore: upgrading package versions

Docs no longer support langchain 0.0.329

Signed-off-by: Patrick O'Connor <35761519+oconpa@users.noreply.github.com>

fix(config): update .projenrc.ts

Add IDE specific ignore folders

Signed-off-by: Michael Walker <michaelhuytran@gmail.com>

feat(configs): add gitignore for IDE files

ci(projen): uncapping cdk version to allow usage with latest cdk less pip error

ci(projen): lowest build version

feat(layer): additional packages prop, rename of layers for ease, typing from layer construct

fix: remove console log statements

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

feat(constructs): add how to section for testing constructs

feat(docs): add screenshots

fix(readme): update README.md

Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
Signed-off-by: Michael Walker <michaelhuytran@gmail.com>

fix(readme): update README.md

Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
Signed-off-by: Michael Walker <michaelhuytran@gmail.com>

fix(readme): update README.md

Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
Signed-off-by: Michael Walker <michaelhuytran@gmail.com>

feat(docs): move to developer guide

feat(docs): move to developer guide

fix: ts-jest configuration under globals

Projen 0.78.9 fixes the warning:

> (WARN) Define `ts-jest` config under `globals` is deprecated

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

fix: correct opt-out logic (awslabs#183)

fix: correct opt-out logic

* dynamically fetch version from the package.json
* include the name of the class
* string format
* camel case solution_id variable and move into context

---------

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

feat(construct): new construct for deployment of custom models to sagemaker (awslabs#180)

* feat(construct): New construct CustomSagemakerEndpoint Fixes (New construct): Add support to deploy custom models to a sagemaker endpoint awslabs#150
* chore(construct): Update documentation
* feat(construct): Add new projen task to run the code generation step (create list of available containers / jumpstart models). Can be used through projen generate-models-containers
* chore(construct): Update list of available models
* fix(construct): Fixes (gen-ai): JumpStartSageMakerEndpoint not working awslabs#179 : address the issue of some models from JumpStart which can't be deployed. This is due to the construct requiring model data to be provided as a compressed object, however some newer JumpStart models provide uncompressed model artifacts. Tested the fix with the reported model - whisper base 2.0.0. Deployed model and ran inference. This requires an upgrade of cdk as the update to the L1 CloudFormation resource was added recently (addition of the property https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnModel.ModelDataSourceProperty.html)

chore(deps): upgrade dependencies (awslabs#188)

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7482301025

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>

fix: use definition instead of schema (awslabs#187)

Closes awslabs#186

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

feat: add husky with a convential commit check (awslabs#189)

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

fix(doc): Update README.md (awslabs#190)

Remove duplicated section from the readme

Signed-off-by: Alain Krok <alkrok@amazon.com>

fix: do not require husky downstream (awslabs#192)

Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>

chore(doc): Update README_custom_sagemaker_endpoint.md (awslabs#191)

Fix image not displayed

Signed-off-by: Alain Krok <alkrok@amazon.com>

chore(deps): upgrade dependencies (awslabs#194)

Upgrades project dependencies. See details in [workflow run].

[Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7508788235

------

*Automatically created by projen via the "upgrade-main" workflow*

Signed-off-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigated p1
Projects
None yet
2 participants