Hi @nscotto,
To resolve modules/parameters/buffers while tracing, a Proxy must be initialized with an underlying Tracer instance. It’s kind-of hacky, but the quickest way I found to fix your code was to write it like this:
import torch
import torch.nn as nn
import torch.fx as fx

module = nn.Module()
submodule = nn.Linear(10, 1)
module.add_module('sub', submodule)

graph = fx.Graph()
raw = graph.placeholder('x')
tracer = torch.fx.Tracer()
tracer.root = module
tracer.graph = graph
x = fx.Proxy(raw, tracer)
y = submodule(x)
output = graph.output(y.node)
gm = fx.GraphModule(module, graph)

print(gm.code)

I think a more idiomatic way of doing this would be to use a custom Tracer that specifies modules to not treat as leaves:
import torch.fx

class SomeModule(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(3, 4)

    def forward(self, x):
        return self.linear(x)

traced = torch.fx.symbolic_trace(SomeModule())
print(traced.code)
"""
def forward(self, x):
    linear = self.linear(x);  x = None
    return linear
"""

# Now we can use a custom tracer to set the linear instance as a non-leaf module
# and thus trace into it

class InlineLinearTracer(torch.fx.Tracer):
    def __init__(self, linears_to_inline):
        super().__init__()
        self.linears_to_inline = linears_to_inline

    def is_leaf_module(self, m: torch.nn.Module, module_qualified_name : str) -> bool:
        if m in self.linears_to_inline:
            return False
        return super().is_leaf_module(m, module_qualified_name)


tracer = InlineLinearTracer([traced.linear])
graph = tracer.trace(traced)
inlined_gm = torch.fx.GraphModule(traced, graph)
print(inlined_gm.code)
"""
def forward(self, x):
    linear_weight = self.linear.weight
    linear_bias = self.linear.bias
    linear = torch.nn.functional.linear(x, linear_weight, bias = linear_bias);  x = linear_weight = linear_bias = None
    return linear
"""