-
Notifications
You must be signed in to change notification settings - Fork 0
Amazon q learning path pr #14
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
base: main
Are you sure you want to change the base?
Changes from all commits
662fcbf
e371c99
3c1d022
7028ff1
fc71adc
098ae41
99bc60e
221c9a7
fbb1df4
af2fbf6
92aa916
a5385eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: Writing Style Check | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: 'PR number to check' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| style-check: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Fetch all history for comparing changes | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install textblob nltk spacy | ||
| python -m spacy download en_core_web_sm | ||
|
|
||
| - name: Fetch PR files | ||
| id: fetch-pr | ||
| run: | | ||
| PR_NUMBER=${{ github.event.inputs.pr_number }} | ||
| echo "Checking PR #${PR_NUMBER}" | ||
| git fetch origin pull/${PR_NUMBER}/head:pr-${PR_NUMBER} | ||
| git checkout pr-${PR_NUMBER} | ||
|
|
||
| - name: List changed files | ||
| id: changed-files | ||
| run: | | ||
| PR_NUMBER=${{ github.event.inputs.pr_number }} | ||
| echo "Changed files in PR #${PR_NUMBER}:" | ||
| git diff --name-only origin/main...pr-${PR_NUMBER} | grep '\.md$' || echo "No markdown files changed" | ||
|
|
||
| - name: Run style guide checker | ||
| id: style-check | ||
| run: | | ||
| python tools/style_checker.py | ||
| env: | ||
| PR_NUMBER: ${{ github.event.inputs.pr_number }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Create suggestions as comments | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const fs = require('fs'); | ||
| if (!fs.existsSync('style_suggestions.json')) { | ||
| console.log('No suggestions found'); | ||
| return; | ||
| } | ||
|
|
||
| const suggestions = JSON.parse(fs.readFileSync('style_suggestions.json', 'utf8')); | ||
| console.log(`Found ${suggestions.length} style suggestions`); | ||
|
|
||
| const prNumber = process.env.PR_NUMBER || '${{ github.event.inputs.pr_number }}'; | ||
|
|
||
| // Add sleep function to add delay between API calls | ||
| const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | ||
|
|
||
| for (const suggestion of suggestions) { | ||
| const { file, line, original, suggested, reason } = suggestion; | ||
|
|
||
| try { | ||
| // Get PR data to ensure we have the correct commit SHA | ||
| const { data: pr } = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: parseInt(prNumber) | ||
| }); | ||
| const headSha = pr.head.sha; | ||
|
|
||
| await github.rest.pulls.createReviewComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: parseInt(prNumber), | ||
| commit_id: headSha, | ||
| path: file, | ||
| body: `**Style Guide Suggestion:**\n\nReason: ${reason}\n\n\`\`\`suggestion\n${suggested}\n\`\`\``, | ||
| line: line, | ||
| side: 'RIGHT' | ||
| }); | ||
| console.log(`Created suggestion for ${file}:${line}`); | ||
|
|
||
| // Add a delay of 2 seconds between comments to avoid rate limiting | ||
| await sleep(2000); | ||
| } catch (error) { | ||
| console.error(`Error creating comment for ${file}:${line}: ${error.message}`); | ||
| } | ||
| } | ||
| env: | ||
| PR_NUMBER: ${{ github.event.inputs.pr_number }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| title: Using Amazon Q for Arm Development | ||
|
|
||
| description: Learn how to leverage Amazon Q to accelerate your Arm-based software development workflow. | ||
|
|
||
| minutes_to_complete: 30 | ||
|
|
||
| who_is_this_for: Software developers working with Arm architecture who want to improve productivity using AI assistance. | ||
|
|
||
| learning_objectives: | ||
| - Understand how Amazon Q can assist with Arm development tasks | ||
| - Set up Amazon Q for your Arm development environment | ||
| - Use Amazon Q to optimize code for Arm architecture | ||
| - Troubleshoot common Arm development issues with Amazon Q | ||
|
|
||
| prerequisites: | ||
| - Basic familiarity with software development | ||
| - An AWS account (free tier is sufficient) | ||
|
|
||
| author: Sample Author | ||
|
|
||
| ### Tags | ||
| skilllevels: Introductory | ||
| subjects: | ||
| - AI/ML | ||
| armips: | ||
| - All | ||
| operatingsystems: | ||
| - Linux | ||
| - Windows | ||
| - macOS | ||
| tools_software_languages: | ||
| - Amazon Q | ||
| - Python | ||
| - C/C++ | ||
|
|
||
| further_reading: | ||
| - resource: | ||
| title: Amazon Q Developer Documentation | ||
| link: https://aws.amazon.com/q/ | ||
| type: website | ||
| - resource: | ||
| title: Arm Developer Documentation | ||
| link: https://developer.arm.com/ | ||
| type: website | ||
|
|
||
| ### FIXED, DO NOT MODIFY | ||
| # ================================================================================ | ||
| weight: 1 # _index.md always has weight of 1 to order correctly | ||
| layout: "learningpathall" # All files under learning paths have this same wrapper | ||
| learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| # ================================================================================ | ||
| # Edit | ||
| # ================================================================================ | ||
|
|
||
| next_step_guidance: | | ||
| Now that you've learned how to use Amazon Q for Arm development, you might want to explore: | ||
| 1. Advanced optimization techniques for specific Arm processors | ||
| 2. Integrating Amazon Q with CI/CD pipelines for Arm builds | ||
| 3. Using Amazon Q with other AWS services optimized for Arm | ||
|
|
||
| # (string) link to the next page | ||
| next_steps_links: | ||
| - title: "Optimizing Python for Arm" | ||
| url: "/learning-paths/cross-platform/python-arm/" | ||
| - title: "AWS Graviton Performance Optimization" | ||
| url: "/learning-paths/servers-and-cloud-computing/graviton/" | ||
| - title: "Cross-Platform Development with Docker on Arm" | ||
| url: "/learning-paths/cross-platform/docker-arm/" | ||
|
|
||
| # (string) 1-5 sentence recommendation outlining how the reader can generally keep learning about these topics, and a specific explanation of why the next step is being recommended. | ||
| recommended_path: "To continue your journey with Arm development, we recommend exploring AWS Graviton Performance Optimization. This will help you apply the Amazon Q knowledge you've gained to optimize workloads on Arm-based cloud instances." | ||
|
|
||
| # (string) 1-5 sentence conclusion summarizing the key points of the learning path and how the reader should feel after completing it | ||
| conclusion: "You've now learned how to leverage Amazon Q to accelerate your Arm development workflow. By using AI assistance for code generation, optimization, and troubleshooting, you can develop more efficient applications for Arm architecture while saving time and effort. Continue exploring the capabilities of Amazon Q as you work on more complex Arm projects." | ||
|
|
||
| # ================================================================================ | ||
| # FIXED, DO NOT MODIFY | ||
| # ================================================================================ | ||
| weight: 7 | ||
| title: "Next Steps" | ||
| layout: "learningpathall" | ||
| --- |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||
| --- | ||||||
| # User change | ||||||
| title: "Best Practices for Using Amazon Q with Arm" | ||||||
|
|
||||||
| weight: 6 # 1 is first, 2 is second, etc. | ||||||
|
|
||||||
| # Do not modify these elements | ||||||
| layout: "learningpathall" | ||||||
| --- | ||||||
|
|
||||||
| To get the most out of Amazon Q for your Arm development projects, follow these best practices and tips. | ||||||
|
|
||||||
| ## Effective prompting for Arm development | ||||||
|
|
||||||
| The quality of Amazon Q's responses depends significantly on how you phrase your questions. Here are some tips for effective prompting: | ||||||
|
|
||||||
| 1. **Be specific about architecture details**: | ||||||
| - Instead of: "How do I optimize this code?" | ||||||
| - Try: "How do I optimize this code for ARMv8-A with NEON?" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimize' with 'improve'.
Suggested change
|
||||||
|
|
||||||
| 2. **Provide context about your target system**: | ||||||
| - "I'm developing for a Raspberry Pi 4 (Cortex-A72)" | ||||||
| - "This code will run on AWS Graviton3 instances" | ||||||
|
|
||||||
| 3. **Mention performance goals**: | ||||||
| - "I need to optimize for power efficiency on an Arm-based IoT device" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimize' with 'improve'.
Suggested change
|
||||||
| - "I'm trying to maximize throughput on an Arm server" | ||||||
|
|
||||||
| 4. **Reference specific Arm technologies**: | ||||||
| - "How can I use SVE2 instructions for this algorithm?" | ||||||
| - "What's the best way to implement this using Arm Helium technology?" | ||||||
|
|
||||||
| ## Integrating Amazon Q into your development workflow | ||||||
|
|
||||||
| Here are strategies for incorporating Amazon Q into your Arm development process: | ||||||
|
|
||||||
| ### During design phase | ||||||
| - Use Amazon Q to explore Arm-specific architectural considerations | ||||||
| - Ask for advice on algorithm selection based on Arm capabilities | ||||||
| - Get recommendations for libraries optimized for Arm | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimized' with 'improved'.
Suggested change
|
||||||
|
|
||||||
| ### During implementation | ||||||
| - Generate starter code optimized for Arm | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimized' with 'improved'.
Suggested change
|
||||||
| - Request examples of Arm-specific optimizations | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimizations' with 'improvements'.
Suggested change
|
||||||
| - Convert existing x86 code to Arm-optimized versions | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimized' with 'improved'.
Suggested change
|
||||||
|
|
||||||
| ### During debugging | ||||||
| - Get help interpreting Arm-specific error messages | ||||||
| - Analyze performance bottlenecks on Arm systems | ||||||
| - Troubleshoot cross-compilation issues | ||||||
|
|
||||||
| ### During optimization | ||||||
| - Request SIMD optimization suggestions using NEON or SVE | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimization' with 'improvement'.
Suggested change
|
||||||
| - Get advice on memory access patterns for Arm's cache hierarchy | ||||||
| - Explore Arm-specific compiler flags and options | ||||||
|
|
||||||
| ## Verifying Amazon Q suggestions | ||||||
|
|
||||||
| While Amazon Q provides valuable assistance, always verify its suggestions: | ||||||
|
|
||||||
| 1. **Test on actual Arm hardware** or emulators to confirm performance improvements | ||||||
| 2. **Benchmark before and after** applying Amazon Q's optimization suggestions | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimization' with 'improvement'.
Suggested change
|
||||||
| 3. **Review generated code** for correctness and security issues | ||||||
| 4. **Consult official Arm documentation** to verify architectural details | ||||||
|
|
||||||
| ## Handling limitations | ||||||
|
|
||||||
| Be aware of Amazon Q's limitations when working with Arm: | ||||||
|
|
||||||
| 1. **Cutting-edge features**: Amazon Q might not be fully updated on the newest Arm technologies | ||||||
| 2. **Specialized domains**: For highly specialized Arm applications, Amazon Q might provide general advice | ||||||
| 3. **Hardware-specific optimizations**: Some optimizations depend on specific Arm implementations | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimizations' with 'improvements'.
Suggested change
|
||||||
|
|
||||||
| When you encounter these limitations: | ||||||
|
|
||||||
| - Ask Amazon Q to explain its reasoning | ||||||
| - Request references to official documentation | ||||||
| - Break complex problems into smaller, more specific questions | ||||||
|
|
||||||
| ## Security considerations | ||||||
|
|
||||||
| When using Amazon Q for development: | ||||||
|
|
||||||
| 1. **Don't share sensitive code** or proprietary algorithms | ||||||
| 2. **Review generated code** for security vulnerabilities | ||||||
| 3. **Don't rely on Amazon Q for security-critical implementations** without thorough review | ||||||
|
|
||||||
| ## Continuous learning | ||||||
|
|
||||||
| To maximize the benefits of using Amazon Q with Arm: | ||||||
|
|
||||||
| 1. **Stay updated on Arm architecture**: Familiarize yourself with the latest Arm features | ||||||
| 2. **Learn Arm optimization principles**: Understanding the fundamentals helps you evaluate Amazon Q's suggestions | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimization' with 'improvement'.
Suggested change
|
||||||
| 3. **Share knowledge**: Contribute your learnings back to the community | ||||||
|
|
||||||
| ## Example workflow | ||||||
|
|
||||||
| Here's an example of an effective workflow using Amazon Q for Arm development: | ||||||
|
|
||||||
| 1. **Initial exploration**: "What are the key considerations when porting my application to Arm64?" | ||||||
| 2. **Architecture-specific guidance**: "How should I structure my data for optimal cache usage on Arm Cortex-A76?" | ||||||
| 3. **Implementation assistance**: "Generate a NEON-optimized version of this image processing function" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimized' with 'improved'.
Suggested change
|
||||||
| 4. **Debugging help**: "Why might this code cause unaligned access exceptions on Arm but not x86?" | ||||||
| 5. **Performance tuning**: "How can I further optimize this code for Arm Neoverse N1?" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style suggestion: Simplify language by replacing 'optimize' with 'improve'.
Suggested change
|
||||||
|
|
||||||
| By following these best practices, you can effectively leverage Amazon Q to enhance your Arm development process and create more efficient, high-performance applications. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style suggestion: Simplify language by replacing 'optimize' with 'improve'.