-
Notifications
You must be signed in to change notification settings - Fork 60
update examples/semiconductor #340
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
Open
TheVinhLuong102
wants to merge
40
commits into
main
Choose a base branch
from
examples/semiconductor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
69d0dd7
add expert plans and knowledge for 1 demo question
srag21 892e29c
update examples/semiconductor/streamlit-main DEFAULT_PROBLEM
TheVinhLuong102 81af153
simplify examples/semiconductor/streamlit-main app
TheVinhLuong102 d22627b
update api
9e3e91b
Merge branch 'examples/semiconductor' of github.com:aitomatic/openssa…
a77f18e
update examles/semiconductor/expert-knowledge.txt
TheVinhLuong102 9488a16
Merge pull request #341 from aitomatic/examples/semicon-optim
TheVinhLuong102 db8a06c
update new plan
3476219
feat: semiconductor ui
vophihungvn 1f7a6ce
Merge branch 'examples/semiconductor' of github.com:aitomatic/openssa…
vophihungvn d4f34b1
parse json
8c12a4d
Merge branch 'examples/semiconductor' of github.com:aitomatic/openssa…
73946a5
feat: setup app stack
vophihungvn e95ed97
Merge branch 'examples/semiconductor' of github.com:aitomatic/openssa…
vophihungvn b167f2d
feat: move to component files
vophihungvn bee7bd4
fix: updated Dockerfile
vophihungvn 60a3ddd
feat: add package json fie
vophihungvn 1aff6cf
update api
fbe1b11
feat: add env file
vophihungvn 7f355a4
handle bugs
c181aa8
feat: integrate backend
vophihungvn 4fd14e1
Merge branch 'examples/semiconductor' of github.com:aitomatic/openssa…
vophihungvn 8392ec1
feat: integrate api
vophihungvn a4e3040
feat: refactor right pane
vophihungvn 558dff6
feat: Add agent advice
vophihungvn 36ada5a
feat: updated UI
vophihungvn e4e731c
fix typos
92330eb
fix placeholder
d8d787c
update examples/semiconductor/streamlit-main
TheVinhLuong102 16b9c3d
refactor examples/semiconductor/streamlit-main app
TheVinhLuong102 050f5b3
update examples/semiconductor/streamlit-main app
TheVinhLuong102 e90354a
feat: log time
vophihungvn 302d9ce
minor edit in examples/semiconductor/agent module imports
TheVinhLuong102 97a4686
Merge branch 'main' of https://GitHub.com/Aitomatic/OpenSSA into exam…
TheVinhLuong102 96e81e5
feat: new UI
vophihungvn dbcb28a
fix: image width
vophihungvn 72c4fa0
feat: response
vophihungvn fdba0d0
fix: get response from backend
vophihungvn b9fcf26
Merge branch 'main' of https://GitHub.com/Aitomatic/OpenSSA into exam…
TheVinhLuong102 f9204bb
Merge branch 'main' of https://GitHub.com/Aitomatic/OpenSSA into exam…
TheVinhLuong102 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| Etching Silicon Dioxide (SiO2): typical recipe(s) | ||
| ================================================= | ||
|
|
||
| If using Inductively Coupled Plasma (ICP) Reactive Ion Etching (RIE) | ||
| -------------------------------------------------------------------- | ||
|
|
||
|
|
||
| GASES & FLOW RATES: | ||
|
|
||
| Common gas is CHF3, often mixed with small amount of Ar and/or O2: | ||
| - CHF3 provides fluorine for etching while also polymerising to provide sidewall protection, improving anisotropy | ||
| - Ar helps maintain stable plasma | ||
| - O2 enhances volatility of etch products | ||
|
|
||
| Typical starting point: | ||
| - 20-50 sccm of CHF3 | ||
| - 5-10 sccm of Ar | ||
| - 2-5 sccm of O2 | ||
|
|
||
|
|
||
| ICP POWER: | ||
|
|
||
| Higher ICP power (e.g., 500-1000W) increases plasma density and etch rate | ||
| BUT may also lead to more physical damage and less anisotropic profiles | ||
|
|
||
|
|
||
| RF POWER: | ||
|
|
||
| Lower RF power (e.g., 10-50W) provides more anisotropic profiles | ||
|
|
||
|
|
||
| PRESSURE: | ||
|
|
||
| Lower pressure (e.g., 5-20 mTorr) helps improve anisotropy | ||
|
|
||
|
|
||
| ETCH TIME: | ||
|
|
||
| You need to adjust etch time depending on desired depth and etch rate. | ||
|
|
||
| Remember that etch rate can vary across wafer and over time, so it's best to overestimate time and measure depth periodically. | ||
|
|
||
|
|
||
| END-POINT DETECTION: | ||
|
|
||
| Many RIE systems have optical emission spectroscopy (OES) or interferometry for end-point detection. | ||
| These can stop etching process when desired depth is reached. | ||
|
|
||
|
|
||
| OPTIMIZATION CONSIDERATIONS: | ||
|
|
||
| - Etch rate | ||
| - Selectivity to mask and underlying layers | ||
| - Etch profile (anisotropy) | ||
| - Uniformity | ||
| - Physical or chemical damage | ||
|
|
||
|
|
||
| SAFETY PROCEDURES: | ||
|
|
||
| - Always follow safety procedures when working with plasma etching systems and handling gases | ||
| - Confirm with facility and equipment manager that your planned recipe is compatible and won't cause any damage or contamination |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| plan: | ||
| task: |- | ||
| For etching PECVD SiO2 using Inductively Coupled Plasma (ICP) Reactive Ion Etching (RIE), | ||
| recommend 2 good parameter sets and their relative advantages/disadvantages | ||
|
|
||
| sub-htps: | ||
| - task: |- | ||
| Get typical gases used for such process and their flow rate ranges | ||
| in SiO2 etching using Inductively Coupled Plasma (ICP) Reactive Ion Etching (RIE) | ||
|
|
||
| - task: |- | ||
| Get typical ICP Power, RF Power and Pressure value ranges and associated trade-offs | ||
| in SiO2 etching using Inductively Coupled Plasma (ICP) Reactive Ion Etching (RIE) | ||
|
|
||
| - task: |- | ||
| Recommend 2 parameter sets (each including Flow Rate for each Gas, plus ICP Power, RF Power and Pressure) | ||
| with analysis of their relative pros and cons. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| FROM --platform=linux/amd64 python:3.10-slim AS base | ||
|
|
||
| # Install Poetry | ||
| RUN apt update -y && apt install poppler-utils -y | ||
| RUN python -m pip install --upgrade pip && \ | ||
| pip install --no-cache-dir poetry==1.3.2 | ||
|
|
||
|
|
||
| RUN poetry config virtualenvs.in-project true && \ | ||
| poetry config installer.max-workers 10 | ||
|
|
||
| WORKDIR /api | ||
|
|
||
| COPY pyproject.toml /api/ | ||
|
|
||
| # ======================================= | ||
| # Build image | ||
| FROM base AS build | ||
|
|
||
| RUN poetry install | ||
|
|
||
|
|
||
| # ======================================= | ||
| # App image | ||
| FROM base AS app | ||
|
|
||
| COPY --from=build /api/.venv /api/.venv | ||
|
|
||
| ENV PATH="/api/.venv/bin:$PATH" | ||
| ENV PATH="/api:$PATH" | ||
| # ENV PATH="/api/openssa:$PATH" | ||
| ENV PYTHONUNBUFFERED=1 | ||
| ENV PYTHONPATH="/" | ||
|
|
||
| COPY . /api/ | ||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| CMD ["sh", "start.sh"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import os | ||
| from fastapi import FastAPI, Request | ||
| from fastapi.middleware.cors import CORSMiddleware | ||
| from collections import defaultdict | ||
| import openai | ||
|
|
||
| app = FastAPI() | ||
|
|
||
| app.add_middleware( | ||
| CORSMiddleware, | ||
| allow_origins=[os.environ.get("FRONTEND_URL", "http://localhost:4000")], | ||
| allow_credentials=True, | ||
| allow_methods=["*"], | ||
| allow_headers=["*"], | ||
| ) | ||
|
|
||
| client = openai.OpenAI(api_key=os.environ['OPENAI_API_KEY']) | ||
|
|
||
| def call_gpt(prompt): | ||
| response = client.chat.completions.create( | ||
| model="gpt-4o", | ||
| messages=[ | ||
| {"role": "system", "content": "You are an expert in parsing text into a specific format. Please help me with this task."}, | ||
| {"role": "user", "content": prompt} | ||
| ] | ||
| ) | ||
| return response.choices[0].message.content | ||
|
|
||
| def parse_recipe_text(text): | ||
| parsed_data = {"recipe_1": "", "recipe_2": "", "agent_advice": ""} | ||
| lines = text.split("\n") | ||
| current_section = None | ||
|
|
||
| for line in lines: | ||
| if "recipe_1:" in line: | ||
| current_section = "recipe_1" | ||
| elif "recipe_2:" in line: | ||
| current_section = "recipe_2" | ||
| elif "agent_advice:" in line: | ||
| current_section = "agent_advice" | ||
| elif current_section: | ||
| parsed_data[current_section] += line + "\n" | ||
|
|
||
| parsed_data = {key: value.strip() for key, value in parsed_data.items()} | ||
| return parsed_data | ||
|
|
||
| def solve_semiconductor_question(question): | ||
| solutions = defaultdict(str) | ||
|
|
||
| solutions[question] = get_or_create_agent(use_semikong_lm=True).solve(problem=question) | ||
|
|
||
| solution = solutions[question] | ||
| solution = solution.replace('$', r'\$') | ||
|
|
||
| prompt = f"""{solution} \n\n Please help me parse the above text into this format:\n | ||
| recipe_1: Show the recipe 1 here\n | ||
| recipe_2: Show the recipe 2 here\n | ||
| agent_advice: Show the agent's general considerations here\n | ||
| DO NOT forget the key and DO NOT change the key format. | ||
| """ | ||
| solution = call_gpt(prompt) | ||
| parsed_solution = parse_recipe_text(solution) | ||
| return parsed_solution | ||
|
|
||
| @app.get("/") | ||
| async def root(): | ||
| return {"message": "Hello World"} | ||
|
|
||
| @app.get("/data") | ||
| async def get_data(): | ||
| return {"data": "data"} | ||
|
|
||
| @app.post("/data") | ||
| async def post_data(request: Request): | ||
| data = await request.json() | ||
| question = data.get('question') | ||
| if not question: | ||
| return {"error": "No question provided"}, 400 | ||
|
|
||
| try: | ||
| parsed_answer = solve_semiconductor_question(question) | ||
| return parsed_answer | ||
| except Exception as e: | ||
| logger.error(f"Error solving the question: {e}") | ||
| return {"error": str(e)}, 500 | ||
|
|
||
17 changes: 17 additions & 0 deletions
17
examples/semiconductor/semiconductor-ui/api/pyproject.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [tool.poetry] | ||
| name = "api" | ||
| version = "0.1.0" | ||
| description = "" | ||
| authors = ["Hung Vo <vophihungvn@gmail.com>"] | ||
| readme = "README.md" | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = "^3.10" | ||
| uvicorn = "^0.30.5" | ||
| fastapi = "^0.112.0" | ||
| openai = "^1.40.1" | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["poetry-core"] | ||
| build-backend = "poetry.core.masonry.api" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uvicorn main:app --loop "asyncio" --proxy-headers --host 0.0.0.0 --port 8080 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .step-item::after { | ||
| content: ''; | ||
| border: 1px solid #e0e0e0; | ||
| } |
31 changes: 31 additions & 0 deletions
31
examples/semiconductor/semiconductor-ui/docker-compose.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| apis: | ||
| container_name: apis | ||
| restart: always | ||
| platform: linux/amd64 | ||
| env_file: .env | ||
| build: | ||
| context: ./api | ||
| dockerfile: ./Dockerfile | ||
| command: sh start.sh | ||
|
|
||
| ports: | ||
| - 9000:8080 | ||
|
|
||
| ui: | ||
| container_name: semiconductor-ui | ||
| restart: always | ||
| build: | ||
| context: ./ui | ||
| target: development | ||
| dockerfile: ./Dockerfile | ||
| environment: | ||
| - VITE_API_HOST=http://localhost:9000 | ||
| volumes: | ||
| - ./ui/src:/app/src | ||
| - ./ui/public:/app/public | ||
| - "./ui/tailwind.config.js:/app/tailwind.config.js" | ||
| ports: | ||
| - 4000:5173 |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.